coef.brmcoda function

Model Coefficients

Model Coefficients

Extract model coefficients, which are the sum of population-level effects and corresponding group-level effects of the brmsfit object in a brmcoda object.

## S3 method for class 'brmcoda' coef(object, ...)

Arguments

  • object: An object of class brmcoda.
  • ...: Further arguments passed to coef.brmsfit.

Returns

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.

Examples

## 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 population and group-level coefficients separately fixef(m) ranef(m) ## extract combined coefficients coef(m) }

See Also

coef.brmsfit