survprep | R Documentation |
Prepare data for regsurv()
survprep(
tte,
delta,
X,
model.scale = c("loghazard", "logHazard"),
time.scale = c("logtime", "time"),
spline.type = c("rcs", "ns"),
ntimebasis,
time.knots = NULL,
tv = NULL,
nitimebasis = NULL,
itime.knots = NULL,
qpoints = 9,
scales = NULL,
shifts = NULL
)
tte |
numeric vector containing time-to-event data |
delta |
numeric vector containing event indicator data (1=event, 0=censored) |
X |
design matrix containing all necessary covariate data |
model.scale |
choose between log hazard and log cumulative hazard |
time.scale |
choose between log time and linear time for the time scale of the model |
spline.type |
type of spline used to model time dependencies (rcs=restricted cubic splines, ns=natural splines (as implemented in the splines2 package)) |
ntimebasis |
integer number of basis columns for the spline representation of the log baseline hazard or log cumulative baseline hazard. |
time.knots |
numeric vector containing baseline spline knot locations. Defaults to equally spaced knots (if NULL). |
tv |
numeric vector of column indices for the columns in X with time-varying (i.e. non-proportional) effects. |
nitimebasis |
number of basis columns for the spline representation of non-proportional covariate effects. |
itime.knots |
numeric vector containing spline knot locations for time-varying covariate effects. Defaults to equally spaced knots (if NULL). |
qpoints |
number of quadrature points for numerical integration over time (only applicable for models on the log hazard scale) |
scales |
only used for internal functions |
shifts |
only used for internal functions |
an object of class survprep
prep <- survprep(tte=simdata$eventtime,
delta=simdata$status,
X=as.matrix(simdata[ ,grep("x", names(simdata))]),
model.scale="loghazard",
time.scale="time",
spline.type="rcs",
ntimebasis=4,
qpoints=9)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.