sig_regions: Regions of significance for an interaction.

View source: R/sig_regions.R

sig_regionsR Documentation

Regions of significance for an interaction.

Description

sig_regions 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

sig_regions(model, ...)

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

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

Arguments

model

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

...

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

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).

Details

This function takes a linear or generalized linear 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).

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.

Methods (by class)

  • sig_regions(lm): Johnson-Neyman points for linear models.

  • sig_regions(glm): Johnson-Neyman points for generalized linear models.

See Also

simple_slopes

Examples

# mtcars data
mtcars$am <- factor(mtcars$am)  # make 'am' categorical
model <- lm(mpg ~ wt * am, data=mtcars)
summary(model)  # significant interaction
sig_regions(model)

reghelper documentation built on Sept. 3, 2023, 1:07 a.m.