modreg: moderated regression

Description Usage Arguments Value Author(s) Examples

Description

moderated regression

Usage

1
2
3
modreg(dv, idv, mod1,
            mod2 = NULL, multMOD1 = 1, multMOD2 = 1, ci = 95,
            xlab = NULL, ylab = NULL)

Arguments

dv

A numeric vector representing the dependent/outcome variable.

idv

A numeric vector representing participant scores on the independent/predictor variable.

mod1

Either a numeric vector (for continuous moderators) or factor (for categorical moderators) representing the first moderator. Note: currently only numeric values are accepted.

mod2

An optional numeric vector or factor representing the second moderator. Note: this option is not currently available.

multMOD1

The number of SD above and below the mean of the first moderator variable, for which simple slope statistics will be calculated.

multMOD2

The number of SD above and below the mean of the second moderator variable, for which simple slope statistics will be calculated.

ci

The confidence level to be calculated. Default is 95.

xlab

The x-axis label for the simple slope plot.

ylab

The y-axis label for the simple slope plot.

Value

A list with the following elements:

lm

The significance test for the multiple regression equation.

beta

The raw and standardized beta weights for the full equation.

slopes

The intercepts and raw (unstandardized) simple slope coefficients for the DV on the IDV at three levels of the moderator.

std_slopes

The standardized simple slopes (beta, SE, and 95% confidence intervals).

slope_dv

The score on the moderator for which the simple slope for the DV on the IDV is zero (flat).

reg_lines

The score on the independent variable for which the simple regression lines for mod = high and mod = low intersect.

Author(s)

Zakary A. Draper & Brian P. O'Connor

Examples

1
2
3
4
# Is the relationship between automobile horsepower and fuel economy moderated by 1/4 mile time?
data(mtcars)
attach(mtcars)
modreg(hp, mpg, qsec)

zakarydraper/modreg documentation built on May 8, 2019, 1:23 p.m.