Learn R Programming

reghelper (version 0.3.3)

graph_model_q: Graph fitted model interactions.

Description

graph_model_q 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_q(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.

Details

Note that in most cases it is easier to use graph_model and pass variable names in directly instead of strings of variable names. graph_model_q uses standard evaluation in cases where such evaluation is easier.

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_q(model, y='Sepal.Width', x='Sepal.Length', lines='Species')
# }

Run the code above in your browser using DataLab