jmcs {FastJM} | R Documentation |
Joint modeling of longitudinal continuous data and competing risks
Description
Joint modeling of longitudinal continuous data and competing risks
Usage
jmcs(
ydata,
cdata,
long.formula,
random = NULL,
surv.formula,
REML = TRUE,
quadpoint = NULL,
maxiter = 10000,
print.para = FALSE,
survinitial = TRUE,
tol = 1e-04,
method = "pseudo-adaptive",
opt = "nlminb"
)
Arguments
ydata |
a longitudinal data frame in long format. |
cdata |
a survival data frame with competing risks or single failure. Each subject has one data entry. |
long.formula |
a formula object with the response variable and fixed effects covariates to be included in the longitudinal sub-model. |
random |
a one-sided formula object describing the random effects part of the longitudinal sub-model.
For example, fitting a random intercept model takes the form |
surv.formula |
a formula object with the survival time, event indicator, and the covariates to be included in the survival sub-model. |
REML |
a logic object that indicates the use of REML estimator. Default is TRUE. |
quadpoint |
the number of pseudo-adaptive Gauss-Hermite quadrature points. to be chosen for numerical integration. Default is 6 which produces stable estimates in most dataframes. |
maxiter |
the maximum number of iterations of the EM algorithm that the function will perform. Default is 10000. |
print.para |
Print detailed information of each iteration. Default is FALSE, i.e., not to print the iteration details. |
survinitial |
Fit a Cox model to obtain initial values of the parameter estimates. Default is TRUE. |
tol |
Tolerance parameter. Default is 0.0001. |
method |
Method for proceeding numerical integration in the E-step. Default is pseudo-adaptive. |
opt |
Optimization method to fit a linear mixed effects model, either |
Value
Object of class jmcs
with elements
beta |
the vector of fixed effects for the linear mixed effects model. |
gamma1 |
the vector of fixed effects for type 1 failure for the survival model. |
gamma2 |
the vector of fixed effects for type 2 failure for the survival model.
Valid only if |
nu1 |
the vector of association parameter(s) for type 1 failure. |
nu2 |
the vector of association parameter(s) for type 2 failure. Valid only if |
H01 |
the matrix that collects baseline hazards evaluated at each uncensored event time for type 1 failure. The first column denotes uncensored event times, the second column the number of events, and the third columns the hazards obtained by Breslow estimator. |
H02 |
the matrix that collects baseline hazards evaluated at each uncensored event time for type 2 failure.
The data structure is the same as |
Sig |
the variance-covariance matrix of the random effects. |
sigma |
the variance of the measurement error for the linear mixed effects model. |
iter |
the total number of iterations until convergence. |
convergence |
convergence identifier: 1 corresponds to successful convergence, whereas 0 to a problem (i.e., when 0, usually more iterations are required). |
vcov |
the variance-covariance matrix of all the fixed effects for both models. |
sebeta |
the standard error of |
segamma1 |
the standard error of |
segamma2 |
the standard error of |
senu1 |
the standard error of |
senu2 |
the standard error of |
seSig |
the vector of standard errors of covariance of random effects. |
sesigma |
the standard error of variance of measurement error for the linear mixed effects model. |
loglike |
the log-likelihood value. |
fitted |
a list with the fitted values:
|
fittedSurv |
the estimated survival rate evaluated at each uncensored event time. |
FUNB |
the estimated random effects for each subject. |
CompetingRisk |
logical value; TRUE if a competing event are accounted for. |
quadpoint |
the number of Gauss Hermite quadrature points used for numerical integration. |
ydata |
the input longitudinal dataset for fitting a joint model.
It has been re-ordered in accordance with descending observation times in |
cdata |
the input survival dataset for fitting a joint model. It has been re-ordered in accordance with descending observation times. |
PropEventType |
a frequency table of number of events. |
LongitudinalSubmodel |
the component of the |
SurvivalSubmodel |
the component of the |
random |
the component of the |
call |
the matched call. |
Quad.method |
the quadrature rule used for integration.
If pseudo-adaptive quadrature rule is used, then return |
id |
the grouping vector for the longitudinal outcome. |
Author(s)
Shanpeng Li lishanpeng0913@ucla.edu
See Also
ranef, fixef, fitted.jmcs,
residuals.jmcs, survfitjmcs, plot.jmcs,
vcov.jmcs
Examples
require(FastJM)
require(survival)
# Load a simulated longitudinal dataset
data(ydata)
# Load a simulated survival dataset with two competing events
data(cdata)
# Fit a joint model
fit <- jmcs(ydata = ydata, cdata = cdata,
long.formula = response ~ time + gender + x1 + race,
surv.formula = Surv(surv, failure_type) ~ x1 + gender + x2 + race,
random = ~ time| ID)
fit
# Extract the parameter estimates of longitudinal sub-model fixed effects
fixef(fit, process = "Longitudinal")
# Extract the parameter estimates of survival sub-model fixed effects
fixef(fit, process = "Event")
# Obtain the random effects estimates for first 6 subjects
head(ranef(fit))
# Obtain the variance-covariance matrix of all parameter estimates
vcov(fit)
# Obtain the result summaries of the joint model fit
summary(fit, process = "Longitudinal")
summary(fit, process = "Event")
# Prediction of cumulative incidence for competing risks data
# Predict the conditional probabilities for two patients who are alive (censored)
ND <- ydata[ydata$ID %in% c(419, 218), ]
ID <- unique(ND$ID)
NDc <- cdata[cdata$ID %in% ID, ]
survfit <- survfitjmcs(fit,
ynewdata = ND,
cnewdata = NDc,
u = seq(3, 4.8, by = 0.2),
method = "GH",
obs.time = "time")
survfit
PE <- PEjmcs(fit, seed = 100, landmark.time = 3, horizon.time = c(3.6, 4, 4.4),
obs.time = "time", method = "GH",
quadpoint = NULL, maxiter = 1000, n.cv = 3,
survinitial = TRUE)
Brier <- summary(PE, error = "Brier")
Brier
MAEQ <- MAEQjmcs(fit, seed = 100, landmark.time = 3, horizon.time = c(3.6, 4, 4.4),
obs.time = "time", method = "GH",
quadpoint = NULL, maxiter = 1000, n.cv = 3,
survinitial = TRUE)
APE <- summary(MAEQ, digits = 3)
APE
## evaluate prediction accuracy of fitted joint model using cross-validated mean AUC
AUC <- AUCjmcs(fit, seed = 100, landmark.time = 3, horizon.time = c(3.6, 4, 4.4),
obs.time = "time", method = "GH",
quadpoint = NULL, maxiter = 1000, n.cv = 3)
summary(AUC, digits = 3)