Learn R Programming

MRStdLCRT (version 0.1.1)

plot.mrs: Plot estimates from an mrs fit

Description

Plots unadjusted vs adjusted estimates with t-based confidence intervals computed from delete-1 cluster jackknife SEs (df = I - 1). Facets by estimand.

Usage

# S3 method for mrs
plot(x, level = 0.95, estimand = NULL, point_size = 2.8, ...)

Value

Invisibly returns a ggplot2 object.

Arguments

x

An object of class "mrs".

level

Confidence level.

estimand

Optional subset of estimands to plot.

point_size

Point size.

...

Unused.

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"
)

plot(fit)
# }

Run the code above in your browser using DataLab