# 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 simple univariate fit
long.formulas <- list(
albumin ~ time + (1 + time|id)
)
surv.formula <- Surv(survtime, status) ~ drug
fit <- joint(long.formulas, surv.formula, PBC, family = list('gaussian'))
fixef(fit, 'long')
fixef(fit, 'surv')
Run the code above in your browser using DataLab