lmROS: Calculate Regions of Significance for 'lm()' Interactions

Description Usage Arguments Details References Examples

View source: R/lmROS.R

Description

This function takes the work of Bauer and Curan (2005) and applies it to a linear model object produced by lm(). Currently, the function handles two types of interactions in the lm() model: (1) Quantitative by Quantitative, Johnson-Neyman Regions-of-Significance; and (2) Quantitative by Categorical, which produces a quasi Region-of-Significance marking values of the Quantitative variable at which the difference of the factor levels change significance.

Usage

1
2
3
4
5
6
7
8
9
lmROS(
  obj,
  interest,
  moderator,
  mod.type = 1,
  int.range = NULL,
  mod.range = NULL,
  alpha.level = 0.05
)

Arguments

obj

Model object containing either a Quantitative by Quantitative interaction or a Quantitative by Categorical interaction from lm().

interest

Variable of interest in the model. Must use quotes.

moderator

Variable designated as the moderator in the model. Must use quotes.

mod.type

Defines the TYPE of interaction. Must be an integer of 1 or 2. 1 = Quantitative by Quantitative. 2 = Quantitative by Categorical. Defaults to 1.

int.range

Optional. Defines the range of the variable of interest to be graphed. Only used when mod.type=2.

mod.range

Optional. Defines the range of the moderator to be graphed.

alpha.level

Designates the alpha for the Region-of-Significnace. Defaults to 0.5.

Details

The ROS graph produced is exported to the Global Environment as ggplot object which can be further edited.

References

Bauer, D.J. & Curran, P.J., (2005), Probing Interactions in Fixed and Multilevel Regression: Inferential and Graphical Techniques, Multivariate Behavioral Research, 40(3), 373–400.

Examples

1
2
3
mod <- lm(mpg ~ wt * hp, data=mtcars)
summary(mod)
lmROS(mod, "wt", "hp")

MichaelJMahometa/SDSRegressionR documentation built on March 3, 2021, 10:51 p.m.