Methods for object of class "jm" for standard generic functions.
coef(object,...)## S3 method for class 'jm'coef(object,...)fixef(object,...)## S3 method for class 'jm'fixef(object, outcome =Inf,...)ranef(object,...)## S3 method for class 'jm'ranef(object, outcome =Inf, post_vars =FALSE,...)terms(x,...)## S3 method for class 'jm'terms(x, process = c("longitudinal","event"), type = c("fixed","random"),...)model.frame(formula,...)## S3 method for class 'jm'model.frame(formula, process = c("longitudinal","event"), type = c("fixed","random"),...)model.matrix(object,...)## S3 method for class 'jm'model.matrix(object,...)family(object,...)## S3 method for class 'jm'family(object,...)compare_jm(..., type = c("marginal","conditional"), order = c("WAIC","DIC","LPML","none"))
Arguments
object, x, formula: object inheriting from class "jm".
outcome: the index of the linear mixed submodel to extract the estimated fixed effects. If greater than the total number of submodels, extracts from all of them.
post_vars: logical; if TRUE, returns the variance of the posterior distribution.
process: which submodel(s) to extract the terms:
if "longitudinal", the linear mixed model(s), or
if "event", the survival model.
type: in terms() and model.frame(), which effects to select in the longitudinal process:
if "fixed", the fixed-effects, or
if "random", the random-efects.
in compare_jm(), which log-likelihood function use to calculate the criteria:
if "marginal", the marginal log-likelihood, or
if "conditional", the conditional log-likelihood.
...: further arguments; currently, none is used.
in compare_jm(), a series of jm objects.
order: which criteria use to sort the models in the output.
Details
coef(): Extracts estimated fixed effects for the event process from a fitted joint model.
fixef(): Extracts estimated fixed effects for the longitudinal processes from a fitted joint model.
ranef(): Extracts estimated random effects from a fitted joint model.
terms(): Extracts the terms object(s) from a fitted joint model.
model.frame(): Creates the model frame from a fitted joint model.
model.matrix(): Creates the design matrices for linear mixed submodels from a fitted joint model.
family(): Extracts the error distribution and link function used in the linear mixed submodel(s) from a fitted joint model.
compare_jm(): Compares two or more fitted joint models using the criteria WAIC, DIC, and LPML.
Returns
coef(): a list with the elements:
* `gammas`: estimated baseline fixed effects, and
* `association`: estimated association parameters.
fixef(): a numeric vector of the estimated fixed effects for the outcome selected. If the outcome is greater than the number of linear mixed submodels, it returns a list of numeric vectors for all outcomes.
ranef(): a numeric matrix with rows denoting the individuals and columns the random effects. If postVar = TRUE, the numeric matrix has the extra attribute "postVar".
terms(): if process = "longitudinal", a list of the terms object(s) for the linear mixed model(s).
if `process = "event"`, the terms object for the survival model.
model.frame(): if process = "longitudinal", a list of the model frames used in the linear mixed model(s).
if `process = "event"`, the model frame used in the survival model.
model.matrix(): a list of the design matrix(ces) for the linear mixed submodel(s).
family(): a list of family objects.
compare_jm(): a list with the elements:
* `table`: a table with the criteria calculated for each joint model, and
* `type`: the log-likelihood function used to calculate the criteria.
# linear mixed model fitsfit_lme1 <- lme(log(serBilir)~ year:sex + age, random =~ year | id, data = pbc2)fit_lme2 <- lme(prothrombin ~ sex, random =~ year | id, data = pbc2)# cox model fitfit_cox <- coxph(Surv(years, status2)~ age, data = pbc2.id)# joint model fitfit_jm <- jm(fit_cox, list(fit_lme1, fit_lme2), time_var ="year", n_chains =1L, n_iter =11000L, n_burnin =1000L)# coef(): fixed effects for the event processcoef(fit_jm)# fixef(): fixed effects for the first linear mixed submodelfixef(fit_jm, outcome =1)# ranef(): random effects from all linear mixed submodelshead(ranef(fit_jm))# terms(): random effects terms for the first linear mixed submodelterms(fit_jm, process ="longitudinal", type ="random")[[1]]# mode.frame(): model frame for the fixed effects in the second# linear mixed submodelhead(model.frame(fit_jm, process ="longitudinal", type ="fixed")[[2]])# model.matrix(): fixed effects design matrix for the first linear# mixed submodelhead(model.matrix(fit_jm)[[1]])# family(): family objects from both linear mixed submodelsfamily(fit_jm)# compare_jm(): compare two fitted joint modelsfit_lme1b <- lme(log(serBilir)~1, random =~ year | id, data = pbc2)fit_jm2 <- jm(fit_cox, list(fit_lme1b, fit_lme2), time_var ="year", n_chains =1L, n_iter =11000L, n_burnin =1000L)compare_jm(fit_jm, fit_jm2)