update.brmcoda {multilevelcoda} | R Documentation |
Update brmcoda
models
Description
This method allows for updating an existing brmcoda
object.
Usage
## S3 method for class 'brmcoda'
update(object, formula. = NULL, newdata = NULL, newcomplr = NULL, ...)
Arguments
object |
A fitted |
formula. |
Changes to the formula; for details see
|
newdata |
A |
newcomplr |
A |
... |
Further arguments passed to |
Value
A brmcoda
with two elements
complr |
An object of class |
model |
An object of class |
See Also
Examples
if(requireNamespace("cmdstanr")){
# model with compositional predictor at between and within-person levels
fit <- brmcoda(complr = complr(data = mcompd, sbp = sbp,
parts = c("TST", "WAKE", "MVPA", "LPA", "SB"),
idvar = "ID"),
formula = Stress ~ bilr1 + bilr2 + bilr3 + bilr4 +
wilr1 + wilr2 + wilr3 + wilr4 + (1 | ID),
chain = 1, iter = 500,
backend = "cmdstanr")
# removing the effect of wilr1
fit1 <- update(fit, formula. = ~ . - wilr1)
# using only a subset
fit2 <- update(fit, newdata = mcompd[ID != 1])
}
[Package multilevelcoda version 1.3.0.2 Index]