Learn R Programming

multilevelcoda (version 1.3.1)

pivot_coord: Estimate pivot balance coordinates

Description

Estimate pivot balance coordinates

Usage

pivot_coord(object, summary = TRUE, method = c("rotate", "refit"), ...)

Value

A list of brmcoda for each pivot balance coordinate.

Arguments

object

An object of class brmcoda.

summary

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

method

A character string. Should the pivot balance coordinates be estimated by "rotate" the sequential binary partition using the same brmcoda object or "refit" the brmcoda object? Default is "rotate".

...

currently ignored.

Examples

Run this code
# \donttest{
if(requireNamespace("cmdstanr")){
  cilr <- complr(data = mcompd, sbp = sbp,
                 parts = c("TST", "WAKE", "MVPA", "LPA", "SB"), idvar = "ID",
                 total = 1440)
  
  # inspects ILRs before passing to brmcoda
  names(cilr$between_logratio)
  names(cilr$within_logratio)
  names(cilr$logratio)
  
  # model with compositional predictor at between and within-person levels
  m <- brmcoda(complr = cilr,
                formula = Stress ~ bilr1 + bilr2 + bilr3 + bilr4 +
                                   wilr1 + wilr2 + wilr3 + wilr4 + (1 | ID),
                chain = 1, iter = 500,
                backend = "cmdstanr")
  
  m_pivot_coord <- pivot_coord(m)
  summary(m_pivot_coord)
  }# }

Run the code above in your browser using DataLab