Sondre U. Solstad
QuickEffectSize is an easy interface for effect size plots in R. Using the Zelig package and ggplot2, it simulates and visualizes effect sizes of any zelig model: simply supply the model and the variable.
By default the plot shows 100 simulations for 100 values of the selected independent variable. These values are set to range from one standard deviation above to one standard deviation below the mean.
Written by Sondre U. Solstad, Princeton University (formerly [email protected] now [email protected]). Send me an email if you find this package useful or want to suggest an improvement or feature.
Installation instructions:
library(devtools)
install_github("sondreus/QuickEffectSize")
library(Zelig)
library(QuickEffectSize)
dat <- data.frame(y = rnorm(100), x1 = rnorm(100), x2 = rnorm(100))
dat$x3 <- dat$y + rnorm(100)
example.model <- zelig(y ~ x1 + x2 + x3, data = dat, model = "normal")
qes(example.model, iv.var = "x3", xlab = "Using qes", ylab = "Productivity")
dat$y2 <- dat$y > 0.98
example.model <- zelig(y2 ~ x1 + x2 + x3, data = dat, model = "probit")
qes(example.model, iv.var = "x3")
- zelig.model - Fitted zelig model
- iv.var - Independent variable.
- xlab - (Optional) Label on x-axis. Defaults to independent variable name.
- ylab - (Optional) Label on y-axis. Defaults to dependent variable name.
- sim.n - (Optional) Number of simulations for each value of iv.var simulated. Defaults to 100.
- range.n - (Optional) Number of different values of iv.var to simulate. Defaults to 100.
- custom.range - (Optional) Vector of two values specifying a range within which different values of iv.var should be simulated.
- return.pdata - (Optional) Should the data to construct the plot be returned instead of the plot itself? Defaults to FALSE.
- progress - (Optional) Should progress be reported? Defaults to TRUE.
- coord.ylim - (Optional) Sets limits on what part of the x.axis to display through ggplots coord_cartesian() function.
- set.covar - (Optional) Option to specify values of other predictors in simulations.
- transform.x - (Optional) If provided a function, transforms x-values according to function before plotting.
- transform.y - (Optional) If provided a function, transforms y-values according to function before plotting.
- ... - (Optional) Additional arguments passed to ggplot2's theme() function.
Solstad, Sondre Ulvund (2019). QuickEffectSize: Quick Effect Size Plots in R. https://github.com/sondreus/QuickEffectSize#quickeffectsize
Zelig: R Core Team. 2008. normal: Normal Regression for Continuous Dependent Variables in Christine Choirat, Christopher Gandrud, James Honaker, Kosuke Imai, Gary King, and Olivia Lau, "Zelig: Everyone's Statistical Software," http://zeligproject.org/
H. Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2016.