Extracts the random effects estimates from a fitted joint model.
# S3 method for jointModel
ranef(object, type = c("mean", "mode"), postVar = FALSE, ...)
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".
an object inheriting from class jointModel
.
what type of empirical Bayes estimates to compute, the mean of the posterior distribution or the mode of the posterior distribution.
logical; if TRUE
the variance of the posterior distribution is also returned. When
type == "mode"
, then this equals
additional arguments; currently none is used.
Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl
Rizopoulos, D. (2012) Joint Models for Longitudinal and Time-to-Event Data: with Applications in R. Boca Raton: Chapman and Hall/CRC.
coef.jointModel
, fixef.jointModel
if (FALSE) {
# 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