Description Usage Arguments Value Examples
Estimate predicted absolute n-year risk from a PC.Cox model object.
1 2 |
object |
object of class 'PC_cox' fit using the 'PC.Cox' function |
newdata |
data.frame with new data for which to calculate predictions. All variables used to fit the PC.Cox model must be present. Observations with missing data will be removed. |
prediction.time |
vector of prediction times (from marker measurement time) to estimate future risk. Prediction time is defined from time of measurement for each individual trajectory. |
A data.frame matching that of newdata but with extra columns containing predicted risk estimates (one for each prediction.time). Risks are estimated for each 'prediction.time' from the measurement time observed on each row.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | data(pc_data)
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
newdata.subj.6 <- pc_data[pc_data$sub.id ==6,]
#estimate 12 and 24 month risk for each measurement time
predict(pc.model.1,
newdata = newdata.subj.6,
prediction.time = c(12, 24))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.