Learn R Programming

reghelper (version 0.3.3)

graph_model: Graph fitted model interactions.

Description

graph_model provides an easy way to graph interactions in fitted models. Selected variables will be graphed at +/- 1 SD (if continuous) or at each level of the factor (if categorical).

Usage

graph_model(model, ...)

Arguments

model

A fitted linear model of type 'lm', 'glm', 'lme', or 'merMod'.

...

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

Value

A ggplot2 graph of the plotted variables in the model.

See Also

graph_model.lm, graph_model.glm

Examples

Run this code
# NOT RUN {
# iris data
model <- lm(Sepal.Width ~ Sepal.Length * Species, data=iris)
graph_model(model, y=Sepal.Width, x=Sepal.Length, lines=Species)
# }

Run the code above in your browser using DataLab