Learn R Programming

JM (version 0.5-0)

ranef: Random Effects Estimates for Joint Models

Description

Extracts the random effects estimates from a fitted joint model.

Usage

## S3 method for class 'jointModel':
ranef(object, postVar = FALSE, \dots)

Arguments

object
an object inheriting from class jointModel.
postVar
logical; if TRUE the variance-covariance matrix of these estimates is also returned. See Details for more info.
...
additional arguments; currently none is used.

Value

  • a numeric matrix with rows denoting the individuals and columns the random effects (e.g., intercepts, slopes, etc.). If postVar = TRUE, the numeric matrix has an extra attribute ``postVar".

Details

For methods "ch-GH", "weibull-GH", "ph-GH" the ranef() method returns the posterior means (and posterior variances if postVar = TRUE), whereas for method "ch-Laplace" it returns the posterior modes (and the inverse of the negative of the second-order derivative of the log-posterior with respect to the random effects, if postVar = TRUE).

See Also

coef.jointModel, fixef.jointModel

Examples

Run this code
# linear mixed model fit
fitLME <- lme(log(serBilir) ~ drug * year, random = ~ 1 | id, data = pbc2)
# survival regression fit
fitSURV <- survreg(Surv(years, status2) ~ drug, data = pbc2.id, x = TRUE)

# joint model fit, under the (default) Weibull model
fitJOINT <- jointModel(fitLME, fitSURV, timeVar = "year")
ranef(fitJOINT)

Run the code above in your browser using DataLab