Learn R Programming

multilevelcoda (version 1.3.3)

pivot_coord_refit: Estimate pivot balance coordinates by refitting model.

Description

This function is an alias of pivot_coord to estimates the pivot balance coordinates by "refit" the brmcoda object.

Usage

pivot_coord_refit(object, summary = TRUE, parts = 1, ...)

Value

Estimated pivot balance coordinates representing the effect of increasing one compositional part relative to the remaining compositional parts.

Arguments

object

An object of class brmcoda.

summary

Should summary statistics be returned instead of the raw values? Default is TRUE.

parts

A optional character string specifying names of compositional parts that should be considered in the substitution analysis. This should correspond to a single set of names of compositional parts specified in the complr object. Default to the first composition in the complr object.

...

Further arguments passed to posterior_summary.

See Also

pivot_coord

Examples

Run this code
# \donttest{
if(requireNamespace("cmdstanr", "brms")){
  x <- complr(data = mcompd, sbp = sbp,
                 parts = c("TST", "WAKE", "MVPA", "LPA", "SB"), idvar = "ID",
                 total = 1440)
  
  m <- brmcoda(complr = x,
                formula = Stress ~ bz1_1 + bz2_1 + bz3_1 + bz4_1 +
                                   wz1_1 + wz2_1 + wz3_1 + wz4_1 + (1 | ID),
                chain = 1, iter = 500,
                backend = "cmdstanr")
  
  m_pivot_coord_refit <- pivot_coord_refit(m)
  summary(m_pivot_coord_refit)
  
  m_pivot_coord_raw <-  pivot_coord_refit(m, summary = FALSE)
  lapply(m_pivot_coord_raw$output, brms::posterior_summary)
  
  }# }

Run the code above in your browser using DataLab