Description Usage Arguments Value Examples
Fit multi-level restricted cubic spline model
1 |
formula |
A model formula for the fixed-effects in the model. Must include one restricted cubic spline term, specified as |
random |
A formula for the random-effects in the model. Random-effects should be specified as a one-sided formula, e.g. |
data |
A data frame containing all variables required for fitting the model. |
... |
Further arguments passed to merlin. |
An object of class mlrcs
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
# Two-level model
data("pbc.merlin", package = "merlin")
fit <- mlrcs(formula = logp ~ 1 + rcs(year, df = 4) + age + trt,
random = ~ 1 + trt | id,
data = pbc.merlin
)
summary(fit)
# Three-level model
fit <- mlrcs(formula = logp ~ 1 + rcs(year, df = 4) + age + trt,
random = list(~ 1 | region,
~ 1 + trt | id),
data = pbc.merlin
)
summary(fit)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.