predData | R Documentation |
Get data for model predictions and uncertainty varied over the range of variable
while holding all other variables at their median values. Can support two-way interactions by specifying a variable name for vary
.
predData(mod, df, variable, vary = NULL, dv, type = "logit")
mod |
A model whose coefficients and variance-covariance matrix will be used to do the predictions. Currently supports logistic regression ( |
df |
A dataframe containing data to be used in prediction. Should contain values for all variables used in |
variable |
A string specifying the variable that will be varied from its minimum to maximum values. |
vary |
An (optional) string specifying a variable to interact with |
dv |
A string specifying which of the variables in |
type |
A string specifying the model type (either 'logit' or 'hurdle'). Defaults to 'logit'. |
A dataframe containing values of variable
(as well as the name of the variable) and corresponding predicted values, as well as the values of the boundaries of 95 percent intervals. These values can easily be used to plot the substantive effect of variable
(and vary
, if applicable) on dv
, according to the results of mod
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.