Learn R Programming

⚠️There's a newer version (1.1.2) of this package.Take me there.

reghelper

The reghelper R package includes a set of functions used to automate commonly used methods in regression analysis. This includes plotting interactions, calculating simple slopes, calculating standardized coefficients, etc.

Version 0.3.3 has been released. However, be aware that this package is still in development, and as such, bugs may still exist, and functions and function parameters may still be subject to change.

To install the most recent stable release, use the following code:

install.packages("devtools")
devtools::install_github("jeff-hughes/reghelper")

If you are interested in helping out with the development process, you can install the development branch with the following code:

install.packages("devtools")
devtools::install_github("jeff-hughes/reghelper@develop")

Installation Issues

Networked computers can sometimes result in installation issues, as the install_github function sometimes has difficulty with networked directories. If this happens to you, use the .libPaths() function to find the path to your R libraries. That will likely give you a path starting with two backslashes, but you will need to convert that to a path starting with a drive letter (e.g., 'C:', 'D:'). From there, use the following code:

install.packages("devtools")
devtools::install_github("jeff-hughes/reghelper", args=c('--library="N:/path/to/libraries/"'))

Obviously, change the path to the path where your R libraries are stored.

Current progress

So far, most functions that I had originally planned to include have been implemented for lm models. These functions include:

  • beta Calculates standardized beta coefficients.
  • build_model Allows variables to be added to a series of regression models sequentially (similar to SPSS).
  • ICC Calculates the intra-class correlation for a multi-level model.
  • cell_means Calculates the estimated means for a fitted model.
  • graph_model Easily graph interactions at +/- 1 SD (uses ggplot2 package).
  • sig_regions Calculate the Johnson-Neyman regions of significance for an interaction.
  • simple_slopes Easily calculate the simple effects of an interaction.

The table below shows the current types of models for which each function has been implemented:

Functionlmglmaovlmelmer
beta
build_model
ICC
cell_means
graph_model
sig_regions
simple_slopes

Copy Link

Version

Install

install.packages('reghelper')

Monthly Downloads

877

Version

0.3.3

License

GPL-3

Maintainer

Jeffrey Hughes

Last Published

April 7th, 2017

Functions in reghelper (0.3.3)

ICC.merMod

Intra-class correlation.
beta

Standardized coeffients of a model.
beta.lme

Standardized coeffients of a model.
ICC

Intra-class correlation.
ICC.lme

Intra-class correlation.
cell_means.lm

Estimated values of a linear model.
cell_means_q.glm

Estimated values of a general linear model.
build_model

Incremental block modelling.
build_model_q

Incremental block modelling.
cell_means_q.lm

Estimated values of a linear model.
coef.block_aov

Extract model coefficients.
print.simple_slopes

Print simple slopes.
print.simple_slopes_lme4

Print simple slopes.
residuals.block_lm

Extract model residuals.
residuals.block_lm_summary

Extract model residuals.
simple_slopes.merMod

Simple slopes of interaction.
summary.block_aov

Summarizing block ANOVA.
beta.glm

Standardized coeffients of a model.
beta.lm

Standardized coeffients of a model.
graph_model.glm

Graph general linear interactions.
graph_model.lm

Graph linear interactions.
beta.merMod

Standardized coeffients of a model.
cell_means

Estimated means.
cell_means.glm

Estimated values of a general linear model.
fitted.block_aov

Extract model fitted values.
fitted.block_glm

Extract model fitted values.
print.block_glm_summary

Summarizing block general linear models.
print.block_lm_summary

Summarizing block regression.
simple_slopes

Simple slopes of interaction.
simple_slopes.glm

Simple slopes of interaction.
graph_model_q.lm

Graph linear interactions.
graph_model_q.lme

Graph multi-level model interactions.
sig_regions

Regions of significance for an interaction.
sig_regions.lm

Regions of significance for an interaction.
coef.block_glm

Extract model coefficients.
coef.block_glm_summary

Extract model coefficients.
fitted.block_lm

Extract model fitted values.
graph_model

Graph fitted model interactions.
simple_slopes.lm

Simple slopes of interaction.
simple_slopes.lme

Simple slopes of interaction.
graph_model.lme

Graph multi-level model interactions.
graph_model.merMod

Graph multi-level model interactions.
reghelper

reghelper: A package to help with running regression analyses.
residuals.block_aov

Extract model residuals.
coef.block_lm

Extract model coefficients.
coef.block_lm_summary

Extract model coefficients.
graph_model_q

Graph fitted model interactions.
graph_model_q.glm

Graph general linear interactions.
graph_model_q.merMod

Graph multi-level model interactions.
print.block_aov_summary

Summarizing block ANOVA.
residuals.block_glm

Extract model residuals.
residuals.block_glm_summary

Extract model residuals.
summary.block_glm

Summarizing block general linear models.
summary.block_lm

Summarizing block regression.