Learn R Programming

reghelper (version 0.3.3)

sig_regions.lm: Regions of significance for an interaction.

Description

sig_regions.lm calculates the Johnson-Neyman (J-N) regions of significance for an interaction, the points at which the simple effect of the categorical predictor changes from non-significant to significant.

Usage

# S3 method for lm
sig_regions(model, alpha = 0.05, precision = 4, ...)

# S3 method for glm sig_regions(model, alpha = 0.05, precision = 4, ...)

Arguments

model

A fitted linear model of type 'lm' with one two-way interaction including one categorical predictor and one continuous variable.

alpha

The level at which to test for significance. Default value is .05.

precision

The number of decimal places to which to round the alpha level (e.g., precision=5 would look for regions of significance at .05000).

...

Not currently implemented; used to ensure consistency with S3 generic.

Value

A named vector with a 'lower' and an 'upper' J-N point. If one or more of the J-N points fall outside the range of your predictor, the function will return NA for that point. If your interaction is not significant, both J-N points will be NA.

Details

This function takes a regression model with one two-way interaction, where one of the predictors in the interaction is categorical (factor) and the other is continuous. For other types of interaction terms, use the simple_slopes function instead.

For more information about regions of significance, see Spiller, Fitzsimons, Lynch, & McClelland (2012).

See Also

simple_slopes.lm

Examples

Run this code
# NOT RUN {
# mtcars data
mtcars$am <- factor(mtcars$am)  # make 'am' categorical
model <- lm(mpg ~ wt * am, data=mtcars)
summary(model)  # significant interaction
sig_regions(model)
# }

Run the code above in your browser using DataLab