JMMLSM | R Documentation |

Joint modeling of longitudinal continuous data and competing risks

```
JMMLSM(
cdata,
ydata,
long.formula,
surv.formula,
variance.formula,
random,
maxiter = 1000,
epsilon = 1e-04,
quadpoint = NULL,
print.para = FALSE,
survinitial = TRUE,
initial.para = NULL,
method = "adaptive",
opt = "nlminb",
initial.optimizer = "BFGS"
)
```

`cdata` |
a survival data frame with competing risks or single failure. Each subject has one data entry. |

`ydata` |
a longitudinal data frame in long format. |

`long.formula` |
a formula object with the response variable and fixed effects covariates to be included in the longitudinal sub-model. |

`surv.formula` |
a formula object with the survival time, event indicator, and the covariates to be included in the survival sub-model. |

`variance.formula` |
an one-sided formula object with the fixed effects covariates to model the variance of 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 ~ 1|ID. Alternatively. Fitting a random intercept and slope model takes the form ~ x1 + ... + xn|ID. |

`maxiter` |
the maximum number of iterations of the EM algorithm that the function will perform. Default is 10000. |

`epsilon` |
Tolerance parameter. Default is 0.0001. |

`quadpoint` |
the number of Gauss-Hermite quadrature points to be chosen for numerical integration. Default is 15 which produces stable estimates in most dataframes. |

`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. |

`initial.para` |
a list of initialized parameters for EM iteration. Default is NULL. |

`method` |
Method for proceeding numerical integration in the E-step. Default is adaptive. |

`opt` |
Optimization method to fit a linear mixed effects model, either nlminb (default) or optim. |

`initial.optimizer` |
Method for numerical optimization to be used. Default is |

Object of class `JMMLSM`

with elements

`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. |

`beta` |
the vector of fixed effects for the mean trajectory in the mixed effects location and scale model. |

`tau` |
the vector of fixed effects for the within-subject variability in the mixed effects location and scale 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 |

`alpha1` |
the vector of association parameter(s) for the mean trajectory for type 1 failure. |

`alpha2` |
the vector of association parameter(s) for the mean trajectory for type 2 failure. Valid only if |

`vee1` |
the vector of association parameter(s) for the within-subject variability for type 1 failure. |

`vee2` |
the vector of association parameter(s) for the within-subject variability 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. |

`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 |

`setau` |
the standard error of |

`segamma1` |
the standard error of |

`segamma2` |
the standard error of |

`sealpha1` |
the standard error of |

`sealpha2` |
the standard error of |

`sevee1` |
the standard error of |

`sevee2` |
the standard error of |

`seSig` |
the vector of standard errors of covariance of random effects. |

`loglike` |
the log-likelihood value. |

`EFuntheta` |
a list with the expected values of all the functions of random effects. |

`CompetingRisk` |
logical value; TRUE if a competing event are accounted for. |

`quadpoint` |
the number of Gauss Hermite quadrature points used for numerical integration. |

`LongitudinalSubmodelmean` |
the component of the |

`LongitudinalSubmodelvariance` |
the component of the |

`SurvivalSubmodel` |
the component of the |

`random` |
the component of the |

`call` |
the matched call. |

```
require(JMH)
data(ydata)
data(cdata)
## fit a joint model
## Not run:
fit <- JMMLSM(cdata = cdata, ydata = ydata,
long.formula = Y ~ Z1 + Z2 + Z3 + time,
surv.formula = Surv(survtime, cmprsk) ~ var1 + var2 + var3,
variance.formula = ~ Z1 + Z2 + Z3 + time,
quadpoint = 6, random = ~ 1|ID, print.para = FALSE)
## make dynamic prediction of two subjects
cnewdata <- cdata[cdata$ID %in% c(122, 152), ]
ynewdata <- ydata[ydata$ID %in% c(122, 152), ]
survfit <- survfitJMMLSM(fit, seed = 100, ynewdata = ynewdata, cnewdata = cnewdata,
u = seq(5.2, 7.2, by = 0.5), Last.time = "survtime",
obs.time = "time", method = "GH")
oldpar <- par(mfrow = c(2, 2), mar = c(5, 4, 4, 4))
plot(survfit, include.y = TRUE)
par(oldpar)
## End(Not run)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.