get_predictions: Get predictions from a model

get_predictionsR Documentation

Get predictions from a model

Description

This function returns a dataframe of model predictions, varying the variables you specify and holding the others constant at zero. Accordingly, it's important to center continuous variables and set up appropriate contrasts for factor variables before running this function.

Usage

get_predictions(m, varying, full_range_var = NULL, sd_to_graph = 1)

Arguments

m

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

varying

A vector of the names of the terms in the model to vary.

full_range_var

Should one of the variables be graphed continuously on the x axis? If so, you can write its name here.

sd_to_graph

When making predictions for continuous variables, the function will make them at +/- this many standard deviations.

Value

A data frame of model predictions.


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