Learn R Programming

MRStdLCRT (version 0.1.1)

summary.mrs: Summarize an mrs fit

Description

Prints key diagnostics (kept periods / mixture table), and per-estimand point estimates with delete-1 cluster jackknife SEs and t-based confidence intervals (df = I - 1). Optionally prints an ICS linear-contrast F-test.

Usage

# S3 method for mrs
summary(
  object,
  level = 0.95,
  estimand = NULL,
  digits = 6,
  show_counts = TRUE,
  ics = "global",
  ics_method = c("both", "unadjusted", "adjusted"),
  ics_tol = 1e-10,
  ...
)

Value

Invisibly returns a list containing printed tables/metadata and (if requested) ICS results.

Arguments

object

An object of class "mrs".

level

Confidence level for Wald-type confidence intervals.

estimand

Optional subset of estimands to print.

digits

Digits to print.

show_counts

If TRUE, print aggregation counts tables.

ics

ICS test specification. Use "global" (default) or "none" to disable. You may also pass a character vector, list spec, or numeric contrast matrix.

ics_method

Which covariance to use for ICS test: "both", "unadjusted", "adjusted".

ics_tol

Numerical tolerance for rank / generalized inverse.

...

Unused (accepts method_type= as alias for ics_method=).

Examples

Run this code
# \donttest{
data(sw_c)
dat <- sw_c[sw_c$cluster %in% sort(unique(sw_c$cluster))[1:6], ]

fit <- mrstdlcrt_fit(
  data = dat,
  formula = y ~ trt + factor(period) + x1 + x2 + (1 | cluster),
  cluster_id = "cluster", period = "period", trt = "trt",
  method = "lmer", family = "gaussian"
)

summary(fit, show_counts = FALSE, ics = "none")
# }

Run the code above in your browser using DataLab