Description Usage Arguments Value See Also Examples
Fit a partly conditional (PC) Cox model. PC models are helpful predictive tools for (medical) contexts where long-term follow-up is available and interest lies in predicting patients’ risks for a future adverse outcome using repeatedly measured predictors over time. These methods model the risk of an adverse event conditional on survival up to a landmark time and information accrued by that time. Methods to smooth markers through time using mixed effect models and BLUP estimates are also implemented.
1 2 |
id |
name of numeric subject id in data |
stime |
name of survival time, may be repeated across subj. id. |
status |
name of survival status indicator, generally 1 = bad outcome/death, 0 alive/censored. |
measurement.time |
name of time of measurement from baseline. |
predictors |
character vector of names for predictors and covariates to include in the model. |
data |
data.frame with id, stime, status, measurement time and predictor variables. Observations with missing data will be removed. |
An object of class "PC_cox" which is a list containing:
model.fit |
A 'coxph' fit object . Please note that the estimates of standard error associated with the model coefficients DO NOT incorporate the variation due to marker smoothing using BLUPs. |
variable.names |
vector of variable names used to fit the model. |
call |
Function call. |
#'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | data(pc_data)
#log transform measurement time for use in models.
pc_data$log.meas.time <- log10(pc_data$meas.time + 1)
pc.model.1 <- PC.Cox(
id = "sub.id",
stime = "time",
status = "status",
measurement.time = "meas.time",
predictors = c("log.meas.time", "marker_1", "marker_2"),
data = pc_data)
pc.model.1
pc.model.1$model.fit #direct access to the coxph model object
#fit a model using
# BLUPs to smooth marker measurements.
#fit mixed effects model to use for blups
myblup.marker1 <- BLUP(marker = "marker_1",
measurement.time = "meas.time",
fixed = c("log.meas.time"),
random = c("log.meas.time"),
id = "sub.id" ,
data = pc_data )
#adding blup estimates to pc_data
fitted.blup.values.m1 <- predict(myblup.marker1, newdata = pc_data)
#fitted.blup.values.m1 includes the fitted blup value
pc_data$marker_1_blup <- fitted.blup.values.m1$fitted.blup
pc.model.2 <- PC.Cox(
id = "sub.id",
stime = "time",
status = "status",
measurement.time = "meas.time",
predictors = c("log.meas.time", "marker_1_blup", "marker_2"),
data = pc_data)
pc.model.2
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.