Skip to contents

Summarizes between-trial standard deviations in the CAMS random-effects structure. For Bayesian CAMS this uses the DIRECT support for \(\tau\) and \(\tau_\gamma\). For frequentist CAMS it uses the stored rma heterogeneity estimates (delta-method SE on \eqn{\hat\tau}; lci / uci from stats::confint() profile intervals on each orthogonal rma block).

Usage

heterogeneity(
  fit,
  component = c("all", "intercept", "slope"),
  trial_var = NULL,
  prob = 0.95,
  summary = TRUE
)

Arguments

fit

A interactmeta from cams().

component

Which SD parameters to return: "intercept" (trial intercept, treatment-effect heterogeneity at the reference information fraction), "slope" (trial SDs of ifrac2_* slopes), or "all" (default).

trial_var

Name of the trial grouping variable; default from the fit's "interactmeta" attribute.

prob

Coverage probability for lci / uci when summary = TRUE.

summary

If TRUE (default), include a summary data frame.

Value

A interactmeta_heterogeneity object (list) with elements draws (long format with columns parameter, type, value) and, when requested, summary (parameter, type, label, estimate, mean, sd, lci, uci, prob). Attributes: prob, trial_var, reference, component.

Examples

if (FALSE) { # \dontrun{
library(interactmeta)
fit <- cams(es, reference = "Lower")
heterogeneity(fit)
heterogeneity(fit, component = "intercept")
} # }