View source: R/plot_discrete.R

plot_weighting_discrete | R Documentation |

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.

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

`mod` |
Weighting model object |

`covariate` |
Covariate vector |

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

`...` |
unused arguments |

A `ggplot2::ggplot`

object.

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)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.