Learn R Programming

reghelper (version 0.3.3)

simple_slopes: Simple slopes of interaction.

Description

simple_slopes is a generic function for calculating the simple effects of an interaction in a regression model.

Usage

simple_slopes(model, ...)

Arguments

model

A fitted linear model of type 'lm', 'glm', 'aov', 'lme' (nlme), or 'merMod' (lme4).

...

Additional arguments to be passed to the particular method for the given model.

Value

The form of the value returned by simple_slopes depends on the class of its argument. See the documentation of the particular methods for details of what is produced by that method.

See Also

simple_slopes.lm, simple_slopes.glm, simple_slopes.aov, simple_slopes.lme, simple_slopes.merMod

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
simple_slopes(model)
simple_slopes(model,
    levels=list(wt=c(2, 3, 4, 'sstest'), am=c(0, 1, 'sstest')))  # test at specific levels
# }

Run the code above in your browser using DataLab