fixef.brmcoda: Population-Level Estimates

View source: R/posterior.R

fixef.brmcodaR Documentation

Population-Level Estimates

Description

Extract the population-level ('fixed') effects from the brmsfit object in a brmcoda object.

Usage

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

Arguments

object

An object of class brmcoda.

...

Further arguments passed to fixef.brmsfit.

Value

If summary is TRUE, a matrix returned by posterior_summary for the population-level effects. If summary is FALSE, a matrix with one row per posterior draw and one column per population-level effect.

See Also

fixef.brmsfit

Examples


## fit a model
if(requireNamespace("cmdstanr")){
  ## fit a model
  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-Level coefficients
  fixef(m)
}

florale/multilevelcoda documentation built on April 21, 2024, 9:44 a.m.