knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

ccesMRPviz

The goal of ccesMRPviz is to visualize and diagnose common tasks in MRP and survey analysis. It was formerly a part of the ccesMRPrun package.

library(dplyr)
library(ccesMRPrun)
library(ccesMRPviz)
# MRP sims setup
mrp_df <- summ_sims(poststrat_draws(fit_GA, poststrat_tgt = acs_GA)) %>%
  left_join(elec_GA)


mrp_df

scatter_45

Currently, the only function is scatter_45, which is a wrapper around ggplot which enforces a visualization of a simple scatterplot that I argue is important for finding patterns in survey estimates relative to ground truth. These graphs:

which makes the plot into a square.

In addition, this wrapper easily enables:

scatter_45(mrp_df,
           clinton_vote,
           p_mrp_est,
           lblvar = cd,
           lbvar = p_mrp_050,
           ubvar = p_mrp_950,
           xlab = "Clinton Vote",
           ylab = "MRP Estimate")


kuriwaki/ccesMRPviz documentation built on May 12, 2022, 11:50 p.m.