Skip to contents

Stable extractor for the observed estimates used in CAMS post-fit analysis. Prefer this over reading undocumented fields on object$data.

Usage

observed_effects(
  object,
  type = c("modifiers", "combined", "interaction", "subgroups"),
  contrast_sep = "-"
)

Arguments

object

A interactmeta from cams().

type

Estimand:

  • "modifiers" (default; "subgroup" / deprecated "subgroups" accepted): one entry per trial × modifier-level row

  • "combined": trial-specific combined-population effect \(m_j\) (inverse-variance combination within each trial)

  • "interaction": trial-specific treatment-by-subgroup interaction \(g_j\) (non-reference minus reference within each trial)

contrast_sep

Separator for interaction labels (default "-").

Value

A list with:

  • estimate: named numeric vector

  • variance: named numeric vector (sampling variances)

  • type: resolved type

  • labels: character vector of names (same order)

For type = "modifiers", names are "<trial> / <subgroup>". For "combined" and "interaction", names are trial IDs.

Examples

if (FALSE) { # \dontrun{
observed <- observed_effects(fit, type = "combined")
observed$estimate["RESPIRE1"]
observed$variance["RESPIRE1"]
} # }