knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
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
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:
facet_wrap
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.