plot_weighting_discrete: Plot weights subdivided by a discrete covariate

View source: R/plot_discrete.R

plot_weighting_discreteR Documentation

Plot weights subdivided by a discrete covariate

Description

This provides a simple plot for the distribution of a single discrete covariate in the nominal sample and the implicit sample defined by the Aronow and Samii (2015) doi: 10.1111/ajps.12185 regression weights.

Usage

plot_weighting_discrete(mod, covariate, alpha = 0.05, ...)

Arguments

mod

Weighting model object

covariate

Covariate vector

alpha

Number between zero and one indicating the desired alpha level for confidence intervals.

...

unused arguments

Value

A ggplot2::ggplot object.

Examples

y <- rnorm(100)
a <- rbinom(100, 1, 0.5)
x <- rnorm(100)
g <- sample(1:4, 100, replace = TRUE)
mod <- stats::lm(y ~ a + x)
rw_mod <- calculate_weights(mod, "a")
plot_weighting_discrete(rw_mod, g)

regweight documentation built on March 18, 2022, 7:53 p.m.