# \donttest{
if(requireNamespace("cmdstanr")){
cilr <- complr(data = mcompd, sbp = sbp,
parts = c("TST", "WAKE", "MVPA", "LPA", "SB"),
idvar = "ID", total = 1440)
# model with compositional predictor at between and within-person levels
fit1 <- brmcoda(complr = cilr,
formula = Stress ~ bilr1 + bilr2 + bilr3 + bilr4 +
wilr1 + wilr2 + wilr3 + wilr4 + (1 | ID),
chain = 1, iter = 500, backend = "cmdstanr")
# one to one reallocation at between and within-person levels
sub1 <- substitution(object = fit1, delta = 5, level = c("between", "within"))
summary(sub1)
# one to all reallocation at between and within-person levels
sub2 <- substitution(object = fit1, delta = 5, level = c("between", "within"),
basesub = "one-to-all")
summary(sub2)
# model with compositional predictor at aggregate level of variance
fit2 <- brmcoda(complr = cilr,
formula = Stress ~ ilr1 + ilr2 + ilr3 + ilr4 + (1 | ID),
chain = 1, iter = 500, backend = "cmdstanr")
sub3 <- substitution(object = fit2, delta = 5, level = c("aggregate"))
}# }
Run the code above in your browser using DataLab