MODERATED_REGRESSION {SIMPLE.REGRESSION}R Documentation

Moderated multiple regression

Description

Conducts moderated regression analyses for two-way interactions with extensive options for interaction plots, including Johnson-Neyman regions of significance. The output includes the Anova Table (Type III tests), standardized coefficients, partial and semi-partial correlations, collinearity statistics, casewise regression diagnostics, plots of residuals and regression diagnostics, and detailed information about simple slopes.

Usage

MODERATED_REGRESSION(data, DV, IV, MOD,
                     IV_type = 'numeric', IV_range = 'tumble',
                     MOD_type='numeric', MOD_levels='quantiles', MOD_range=NULL,
                     quantiles_IV = c(.1, .9), quantiles_MOD = c(.25, .5, .75),
                     COVARS = NULL,
                     center = TRUE, 
                     plot_type = 'residuals', plot_title = NULL, DV_range = NULL,
                     Xaxis_label = NULL, Yaxis_label = NULL, legend_label = NULL,
                     JN_type = 'Huitema', 
                     verbose = TRUE )

Arguments

data

A dataframe where the rows are cases and the columns are the variables.

DV

The name of the dependent variable.
Example: DV = 'outcomeVar'

IV

The name of the independent variable.
Example: IV = 'varA'

MOD

The name of the moderator variable
Example: MOD = 'varB'

IV_type

(optional) The type of independent variable. The options are 'numeric' (the default) or 'factor'.
Example: IV_type = 'factor'

IV_range

(optional) The independent variable range for a moderated regression plot. The options are:

  • 'tumble' (the default), for tumble graphs following Bodner (2016)

  • 'quantiles', in which case the 10th and 90th quantiles of the IV will be used (alternative values can be specified using the quantiles_IV argument);

  • 'AikenWest', in which case the IV mean - one SD, and the IV mean + one SD, will be used;

  • a vector of two user-provided values (e.g., c(1, 10)); and

  • NULL, in which case the minimum and maximum IV values will be used.

Example: IV_range = 'AikenWest'

MOD_type

(optional) The type of moderator variable. The options are 'numeric' (the default) or 'factor'.
Example: MOD_type = 'factor'

MOD_levels

(optional) The levels of the moderator variable to be used if MOD is continuous. The options are:

  • 'quantiles', in which case the .25, .5, and .75 quantiles of the MOD variable will be used (alternative values can be specified using the quantiles_MOD argument);

  • 'AikenWest', in which case the mean of MOD, the mean of MOD - one SD, and the mean of MOD + one SD, will be used; and

  • a vector of two user-provided values.

Example: MOD_levels = c(1, 10)

MOD_range

(optional) The range of the MOD values to be used in the Johnson-Neyman regions of significance analyses. The options are: NULL (the default), in which case the minimum and maximum MOD values will be used; and a vector of two user-provided values.
Example: MOD_range = c(1, 10)

quantiles_IV

(optional) The quantiles of the independent variable to be used as the IV range for a moderated regression plot.
Example: quantiles_IV = c(.10, .90)

quantiles_MOD

(optional) The quantiles the moderator variable to be used as the MOD simple slope values in the moderated regression analyses.
Example: quantiles_MOD = c(.25, .5, .75)

COVARS

(optional) The name(s) of possible covariates.
Example: COVARS = c('CovarA', 'CovarB', 'CovarC')

center

(optional) Logical, indicating whether the IV and MOD variables should be centered (default = TRUE).
Example: center = FALSE

plot_type

(optional) The kind of plot, if any. The options are:

  • 'residuals' (the default)

  • 'diagnostics' (for regression diagnostics)

  • 'interaction' (for a traditional moderated regression interaction plot)

  • 'regions' (for a moderated regression Johnson-Neyman regions of significance plot), and

  • 'none' (for no plots).

Example: plot_type = 'diagnostics'

plot_title

(optional) The plot title.
Example: plot_title = 'Interaction Plot'

DV_range

(optional) The range of Y-axis values for the plot.
Example: DV_range = c(1,10)

Xaxis_label

(optional) A label for the X axis to be used in the requested plot.
Example: Xaxis_label = 'IV name'

Yaxis_label

(optional) A label for the Y axis to be used in the requested plot.
Example: Yaxis_label = 'DV name'

legend_label

(optional) A legend label for the plot.
Example: legend_label = 'MOD name'

JN_type

(optional) The formula to be used in computing the critical F value for the Johnson-Neyman regions of significance analyses. The options are 'Huitema' (the default), or 'Pedhazur'.
Example: JN_type = 'Pedhazur'

verbose

Should detailed results be displayed in console? The options are: TRUE (default) or FALSE. If TRUE, plots of residuals are also produced.

Value

An object of class "MODERATED_REGRESSION". The object is a list containing the following possible components:

modelMAINsum

All of the summary.lm function output for the regression model without interaction terms.

anova_table

Anova Table (Type III tests).

mainRcoefs

Predictor coefficients for the model without interaction terms.

modeldata

All of the predictor and outcome raw data that were used in the model, along with regression diagnostic statistics for each case.

collin_diags

Collinearity diagnostic coefficients for models without interaction terms.

modelXNsum

Regression model statistics with interaction terms.

RsqchXn

Rsquared change for the interaction.

fsquaredXN

fsquared change for the interaction.

xnRcoefs

Predictor coefficients for the model with interaction terms.

simslop

The simple slopes.

simslopZ

The standardized simple slopes.

plotdon

The plot data for a moderated regression.

JN.data

The Johnson-Neyman results for a moderated regression.

ros

The Johnson-Neyman regions of significance for a moderated regression.

Author(s)

Brian P. O'Connor

References

Bodner, T. E. (2016). Tumble graphs: Avoiding misleading end point extrapolation when graphing interactions from a moderated multiple regression analysis. Journal of Educational and Behavioral Statistics, 41, 593-604.

Cohen, J., Cohen, P., West, S. G., & Aiken, L. S. (2003). Applied multiple regression/correlation analysis for the behavioral sciences (3rd ed.). Lawrence Erlbaum Associates.

Darlington, R. B., & Hayes, A. F. (2017). Regression analysis and linear models: Concepts, applications, and implementation. Guilford Press.

Hayes, A. F. (2018a). Introduction to mediation, moderation, and conditional process analysis: A regression-based approach (2nd ed.). Guilford Press.

Hayes, A. F., & Montoya, A. K. (2016). A tutorial on testing, visualizing, and probing an interaction involving a multicategorical variable in linear regression analysis. Communication Methods and Measures, 11, 1-30.

O'Connor, B. P. (1998). All-in-one programs for exploring interactions in moderated multiple regression. Educational and Psychological Measurement, 58, 833-837.

Pedhazur, E. J. (1997). Multiple regression in behavioral research: Explanation and prediction. (3rd ed.). Wadsworth Thomson Learning.

Examples

# moderated regression	-- with IV_range = 'AikenWest'
MODERATED_REGRESSION(data=data_Lorah_Wong_2018, DV='suicidal', IV='burden',  MOD='belong_thwarted', 
                     IV_range='AikenWest',
                     MOD_levels='quantiles',
                     quantiles_IV=c(.1, .9), quantiles_MOD=c(.25, .5, .75),
                     center = TRUE, COVARS='depression', 
                     plot_type = 'interaction', plot_title=NULL, DV_range = c(1,1.25))

# moderated regression	-- with  IV_range = 'tumble'
MODERATED_REGRESSION(data=data_Lorah_Wong_2018, DV='suicidal', IV='burden', MOD='belong_thwarted', 
                     IV_range='tumble',
                     MOD_levels='quantiles',
                     quantiles_IV=c(.1, .9), quantiles_MOD=c(.25, .5, .75),
                     center = TRUE, COVARS='depression', 
                     plot_type = 'interaction', plot_title=NULL, DV_range = c(1,1.25)) 

# moderated regression	-- with numeric values for IV_range & MOD_levels='AikenWest'       
MODERATED_REGRESSION(data=data_OConnor_Dvorak_2001, DV='Aggressive_Behavior', 
                     IV='Maternal_Harshness', MOD='Resiliency', 
                     IV_range=c(1,7.7), 
                     MOD_levels='AikenWest', MOD_range=NULL,
                     quantiles_IV=c(.1, .9), quantiles_MOD=c(.25, .5, .75),
                     center = FALSE, 
                     plot_type = 'interaction', 
                     DV_range = c(1,6), 
                     Xaxis_label='Maternal Harshness', 
                     Yaxis_label='Adolescent Aggressive Behavior', 
                     legend_label='Resiliency')


[Package SIMPLE.REGRESSION version 0.1.9 Index]