knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "fig/README-"
)

lme4plotpartial

R package to plot the complete pooling, no pooling, and partially pooled estimates for a mixed effects model based on code from TJ Mahr.

Installation

You can install lme4plotpartial from github with:

# install.packages("devtools")
devtools::install_github("jrosen48/lme4plotpartial")

Example

Has one function, plot_partial_pooling(), used as follows:

library(lme4plotpartial)
library(dplyr, warn.conflicts = FALSE)
library(ggforce)

p <- plot_partial_pooling(storms, y_var = wind, x_var = pressure, group = year)

# Split the facets over several pages
p + facet_wrap_paginate("year", ncol = 3, nrow = 4, page = 1)
p + facet_wrap_paginate("year", ncol = 3, nrow = 4, page = 2) 
p + facet_wrap_paginate("year", ncol = 3, nrow = 4, page = 3) 
p + facet_wrap_paginate("year", ncol = 3, nrow = 4, page = 4) 

Future Improvements



jrosen48/lme4plotpartial documentation built on May 29, 2019, 2:25 p.m.