ranef.joint {gmvjoint} | R Documentation |
Extract random effects from a joint
object.
Description
Return the random effects which maximises the complete
data log-likelihood at the MLEs
.
Usage
## S3 method for class 'joint'
ranef(object, Var = FALSE, ...)
Arguments
object |
a joint model fit by the |
Var |
logical, should the estimated variance of the random effects at |
... |
additional arguments (none used). |
Value
A matrix
containing required random effects effects. If Var=TRUE
,
instead a list is returned with first element the matrix
of random effects and second a
matrix
of the variances . Note that these are posterior modes
of the random effects. Conditional distribution can be found by
cond.ranefs
.
Author(s)
James Murray (j.murray7@ncl.ac.uk).
See Also
Examples
# Univariate fit on PBC data -----------------------------------------
data(PBC)
# Subset data and remove NAs
PBC <- subset(PBC, select = c('id', 'survtime', 'status', 'drug', 'time',
'albumin'))
PBC <- na.omit(PBC)
# Specify univariate fit
long.formulas <- list(
albumin ~ time*drug + (1 + time|id)
)
surv.formula <- Surv(survtime, status) ~ drug
fit <- joint(long.formulas, surv.formula, PBC, family = list('gaussian'))
b <- ranef(fit, FALSE)
[Package gmvjoint version 0.4.0 Index]