ranef.brmcoda | R Documentation |
Extract the group-level ('random') effects of each level
of the brmsfit
object in a brmcoda
object.
## S3 method for class 'brmcoda'
ranef(object, ...)
object |
An object of class |
... |
Further arguments passed to |
A list of 3D arrays (one per grouping factor).
If summary
is TRUE
,
the 1st dimension contains the factor levels,
the 2nd dimension contains the summary statistics
(see posterior_summary
), and
the 3rd dimension contains the group-level effects.
If summary
is FALSE
, the 1st dimension contains
the posterior draws, the 2nd dimension contains the factor levels,
and the 3rd dimension contains the group-level effects.
ranef.brmsfit
## fit a model
if(requireNamespace("cmdstanr")){
m <- brmcoda(complr = complr(data = mcompd, sbp = sbp,
parts = c("TST", "WAKE", "MVPA", "LPA", "SB"),
idvar = "ID", total = 1440),
formula = Stress ~ bilr1 + bilr2 + bilr3 + bilr4 +
wilr1 + wilr2 + wilr3 + wilr4 + (1 | ID),
chain = 1, iter = 500,
backend = "cmdstanr")
## extract group-level coefficients
ranef(m)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.