| lme | R Documentation |
These functions are S3 generics exported by JMbayes2 to enable method dispatch
on the class of the data argument. When data is a "sliced_data"
object (as produced by slicer), the corresponding slice-wise fitting
methods are used.
lme(fixed, data, ...)
coxph(formula, data, ...)
mixed_model(fixed, data, ...)
fixed |
For |
formula |
For |
data |
A data frame (default methods) or a |
... |
Further arguments passed to the underlying model-fitting functions.
For slice-wise methods, additional arguments include |
When data is a regular data frame, the default methods call
nlme::lme(), survival::coxph(), and GLMMadaptive::mixed_model(),
respectively.
When data is a "sliced_data" object, the corresponding *.sliced_data
methods fit the requested model independently within each slice and return a list of
fits (one per slice).
JMbayes2 exports S3 generics lme(), coxph(), and mixed_model()
to enable dispatch on "sliced_data". When JMbayes2 is attached, these names
mask nlme::lme, survival::coxph, and GLMMadaptive::mixed_model.
Use the pkg::fun form to call the original functions.
slicer, nlme::lme, survival::coxph, GLMMadaptive::mixed_model.
## Not run:
slc <- slicer(n_slices = 2, id_var = "id", data_long = pbc2, data_surv = pbc2.id)
n_cores <- max(parallel::detectCores() - 1L, 1L)
lme_fit <- lme(fixed = log(serBilir) ~ year * sex,
data = slc$long,
random = ~ year | id,
cores = n_cores)
cox_fit <- coxph(formula = Surv(years, status2) ~ sex,
data = slc$surv,
cores = n_cores)
mxm_fit <- mixed_model(fixed = ascites ~ year + sex,
data = slc$long,
random = ~ year | id,
family = binomial(),
cores = n_cores)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.