graph_effect: Graph a single effect, given a model.

graph_effectR Documentation

Graph a single effect, given a model.

Description

This function is intended to quickly graph a single set of predictions, given a model.

Usage

graph_effect(
  model,
  x,
  fill = NULL,
  facet = NULL,
  facet2 = NULL,
  continuous_x = FALSE,
  colors = NULL
)

Arguments

x

the name of the variable that should be graphed on the x axis.

fill

the (optional) name of the variable that should be graphed as a fill.

facet

the (optional) name of the variable that should be graphed as a facet.

facet2

the (optional) name of the variable that should be graphed as a second facet.

continuous_x

If true, a line graph will be created for any continuous variables, rather than bar graphs with predicted values at +1/-1 SD.

colors

An optional vector of colors for the bars and lines of graphs.

m

A linear model. Standard OLS or logistic regression will work.

Value

A ggplot line or bar graph.


michaelasher/asherR documentation built on July 5, 2023, 8:55 p.m.