update.brmcoda | R Documentation |
brmcoda
modelsThis method allows for updating an existing brmcoda
object.
## S3 method for class 'brmcoda'
update(object, formula. = NULL, newdata = NULL, newcomplr = NULL, ...)
object |
A fitted |
formula. |
Changes to the formula; for details see
|
newdata |
A |
newcomplr |
A |
... |
Further arguments passed to |
A brmcoda
with two elements
complr |
An object of class |
model |
An object of class |
brmcoda
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])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.