Type: | Package |
Title: | Visualization of Restricted Cubic Splines |
Version: | 0.4.0 |
Maintainer: | Zhiqiang Nie <niezhiqiang@gdph.org.cn> |
Description: | Restricted Cubic Splines were performed to explore the shape of association form of "U, inverted U, L" shape and test linearity or non-linearity base on "Cox,Logistic,linear,quasipoisson" regression, and auto output Restricted Cubic Splines figures. rcssci package could automatically draw RCS graphics with Y-axis "OR,HR,RR,beta". The Restricted Cubic Splines method were based on Suli Huang (2022) <doi:10.1016/j.ecoenv.2022.113183>,Amit Kaura (2019) <doi:10.1136/bmj.l6055>, and Harrell Jr (2015, ISBN:978-3-319-19424-0 (Print) 978-3-319-19425-7 (Online)). |
Depends: | R (≥ 4.2.0) |
LazyData: | true |
Imports: | pacman, rms, ggplot2, survminer, segmented, survival, dplyr, patchwork, Cairo |
Encoding: | UTF-8 |
License: | Artistic-2.0 |
BugReports: | https://github.com/popnie/RCSsci/issues |
RoxygenNote: | 7.2.1 |
NeedsCompilation: | no |
Packaged: | 2023-02-15 05:09:57 UTC; niezh |
Author: | Zhiqiang Nie [aut, cre, cph] (ORCID = 0000-0001-7642-3286, wechat = Biostatistics-SCI), JunZhang [ctb], Chaolei Chen [ctb] |
Repository: | CRAN |
Date/Publication: | 2023-02-15 21:20:02 UTC |
rcs_cox.lshap
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
time |
censor time |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
Cox models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_cox.lshap(data=sbpdata, y = "status",x = "sbp",time = "time",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcs_cox.lshap(knot=4,data=sbpdata, y = "status",x = "sbp",covs=c("age"),
# time = "time", prob=0.1,filepath="D:/temp")
rcs_cox.nshap
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
time |
censor time |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
Cox models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_cox.nshap(data=sbpdata, y = "status",x = "sbp",time = "time",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcs_cox.nshap(knot=4,data=sbpdata, y = "status",x = "sbp",covs=c("age"),
# time = "time", prob=0.1,filepath="D:/temp")
rcs_cox.prob
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
time |
censor time |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
Cox models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_cox.prob(data=sbpdata, y = "status",x = "sbp",time = "time",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcs_cox.prob(knot=4,data=sbpdata, y = "status",x = "sbp",covs=c("age"),
# time = "time", prob=0.1,filepath="D:/temp")
rcs_cox.ushap
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
time |
censor time |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
Cox models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_cox.ushap(data=sbpdata, y = "status",x = "sbp",time = "time",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcs_cox.ushap(knot=4,data=sbpdata, y = "status",x = "sbp",covs=c("age"),
# time = "time", prob=0.1,filepath="D:/temp")
rcs_linear.lshap
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
linear models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_linear.lshap(data=sbpdata, y = "sbp",x = "age",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcs_linear.lshap(knot=4,data=sbpdata, y = "sbp",x = "age",
# covs=c("gender"),prob=0.1,filepath="D:/temp")
rcs_linear.nshap
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
linear models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_linear.nshap(data=sbpdata, y = "sbp",x = "age",
prob=0.1,filepath=tempdir())
# library(rcssci
# rcs_linear.nshap(knot=4,data=sbpdata, y = "sbp",x = "age",
# covs=c("gender"),prob=0.1,filepath="D:/temp")
rcs_linear.prob
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
linear models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_linear.prob(data=sbpdata, y = "sbp",x = "age",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcs_linear.prob(knot=4,data=sbpdata, y = "sbp",x = "age",
# covs=c("gender"),prob=0.1,filepath="D:/temp")
rcs_linear.ushap
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
linear models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_linear.ushap(data=sbpdata, y = "sbp",x = "age",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcs_linear.ushap(knot=4,data=sbpdata, y = "sbp",x = "age",
# covs=c("gender"),prob=0.1,filepath="D:/temp")
rcs_logistic.lshap
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
logistic models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_logistic.lshap(data=sbpdata, y = "status",x = "sbp",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcs_logistic.lshap(knot=4,data=sbpdata, y = "status",x = "sbp",
# covs=c("age","gender"),prob=0.1,filepath="D:/temp")
rcs_logistic.nshap
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
logistic models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_logistic.nshap(data=sbpdata, y = "status",x = "sbp",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcs_logistic.nshap(knot=4,data=sbpdata, y = "status",x = "sbp",
# covs=c("age","gender"),prob=0.1,filepath="D:/temp")
rcs_logistic.prob
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
logistic models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_logistic.prob(data=sbpdata, y = "status",x = "sbp",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcs_logistic.prob(knot=4,data=sbpdata, y = "status",x = "sbp",
# covs=c("age","gender"),prob=0.1,filepath="D:/temp")
rcs_logistic.ushap
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
logistic models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_logistic.ushap(data=sbpdata, y = "status",x = "sbp",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcs_logistic.ushap(knot=4,data=sbpdata, y = "status",x = "sbp",
# covs=c("age","gender"),prob=0.1,filepath="D:/temp")
rcs_quasipoisson.lshap
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
quasipoisson models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_quasipoisson.lshap(data=sbpdata, y = "status",x = "sbp",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcs_quasipoisson.lshap(knot=4,data=sbpdata, y = "status",x = "sbp",
# covs=c("age","gender"),prob=0.1,filepath="D:/temp")
rcs_quasipoisson.nshap
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
quasipoisson models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_quasipoisson.nshap(data=sbpdata, y = "status",x = "sbp",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcs_quasipoisson.nshap(knot=4,data=sbpdata, y = "status",x = "sbp",
# covs=c("age","gender"),prob=0.1,filepath="D:/temp")
rcs_quasipoisson.prob
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
quasipoisson models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_quasipoisson.prob(data=sbpdata, y = "status",x = "sbp",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcs_quasipoisson.prob(knot=4,data=sbpdata, y = "status",x = "sbp",
# covs=c("age","gender"),prob=0.1,filepath="D:/temp")
rcs_quasipoisson.ushap
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
quasipoisson models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcs_quasipoisson.ushap(data=sbpdata, y = "status",x = "sbp",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcs_quasipoisson.ushap(knot=4,data=sbpdata, y = "status",x = "sbp",
# covs=c("age","gender"),prob=0.1,filepath="D:/temp")
rcssci_cox
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
time |
censor time |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
Cox models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcssci_cox(data=sbpdata, y = "status",x = "sbp",time = "time",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcssci_cox(knot=4,data=sbpdata, y = "status",x = "sbp",covs=c("age"),
# time = "time", prob=0.1,filepath="D:/temp")
rcssci_linear
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
linear models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcssci_linear(data=sbpdata, y = "sbp",x = "age",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcssci_linear(knot=4,data=sbpdata, y = "sbp",x = "age",
# covs=c("gender"),prob=0.1,filepath="D:/temp")
rcssci_logistic
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
logistic models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcssci_logistic(data=sbpdata, y = "status",x = "sbp",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcssci_logistic(knot=4,data=sbpdata, y = "status",x = "sbp",
# covs=c("age","gender"),prob=0.1,filepath="D:/temp")
rcssci_quasipoisson
Description
restricted cubic splines (RCS) published in SCI.
Arguments
data |
data.frame.Rdata |
knot |
knot=3-7 or automatic calculate by AIC min |
y |
outcome=0,1 |
covs |
covariables, univariate analysis without "covs" command, multivariable analysis with "covs" command |
prob |
position parameter,range from 0-1 |
x |
main exposure and X-axis when plotting |
filepath |
path of plots output. |
Details
quasipoisson models with RCS splines were performed to explore the shape linear or nonlinear(U, inverted U,J,S,L,log,-log,temporary plateau shape)
Value
message.print PH assumption and other message
Author(s)
Zhiqiang Nie, niezhiqiang@gdph.org.cn
Examples
library(rcssci)
rcssci_quasipoisson(data=sbpdata, y = "status",x = "sbp",
prob=0.1,filepath=tempdir())
# library(rcssci)
# rcssci_quasipoisson(knot=4,data=sbpdata, y = "status",x = "sbp",
# covs=c("age","gender"),prob=0.1,filepath="D:/temp")
A data on sbp and status.
Description
A data on sbp and status.
Usage
data(sbpdata)
Format
An object of class tbl_df
(inherits from tbl
, data.frame
) with 3621 rows and 5 columns.
Examples
data(sbpdata)