Nov 1, 2017
The partlyconditional
R package provides model fitting procedures to fit partly conditional (PC) risk models. These models are often employed in medical contexts where long term follow-up information is available on a patient population along with repeated measures of patient health and other biological markers collected across time. Interest lies in predicting patients' risk of a future adverse outcome using longitudinal data collected up until the time of prediction.
In the figure below, the black dotted lines in the left two panels display hypothetical marker values for a single subject collected across 54 months of patient history. The right panel shows risk estimated using a PC model for the 'next' 12 months conditional on the observed marker trajectories. The left two panels also show 'smoothed' marker trajectories represented by blue lines. If markers are suspected to be measured with error, using smoothed marker values instead of raw marker values in a predictive model can improve model performance. Methods in this package allow for marker smoothing using mixed effect models to estimate the 'best unbiased linear predictor' (BLUP) for each marker trajectory across time.
Specifically, partly conditional models predict the risk of an adverse event in the next
Where
This package provides functions to fit two classes of partly conditional models--a 'Cox' type approach that models the conditional hazard of failure using a Cox proportional hazards model (PC.Cox
) and a 'GLM' approach where a marginal generalized linear model is employed (PC.GLM
).
The PC.Cox
function fits a partly conditional Cox model of the form:
where
Another flexible approach is to fit a PC glm model using PC.GLM
. For this approach, a marginal generalized linear model is specified for the binary outcome defined by survival time
As before,
Methods describing model fitting procedures that account for censored individuals are described in the manuscript cited below.
Before fitting a PC model, partlyconditional
functions include procedures to first smooth a marker
for measurement
To obtain smoothed marker values to use for a new prediction, we then estimate the best linear unbiased predictors (BLUPs)
Please see references below for further details.
Package can be downloaded directly from Github using the devtools
package.
library(devtools)
###install
devtools::install_github("mdbrown/partlyconditional")
All package code is also available on Github here.
An in-depth tutorial is available here.
Zheng YZ, Heagerty PJ. Partly conditional survival models for longitudinal data. Biometrics. 2005;61:379โ391.
Maziarz, M., Heagerty, P., Cai, T. and Zheng, Y. (2017), On longitudinal prediction with time-to-event outcome: Comparison of modeling options. Biom, 73: 83โ93. doi:10.1111/biom.12562