get_predictions | R Documentation |
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.
get_predictions(m, varying, full_range_var = NULL, sd_to_graph = 1)
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. |
A data frame of model predictions.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.