model_predictions: Get predictions from a linear model or generalized linear...

Description Usage Arguments Details Value

Description

If no data are provided, modelPredictions returns a numeric vector predicted values for the sample, functioning as a simple wrapper for fitted.values(). If a dataframe with new values for Xs are provided, modelPredictions adds predicted values and SEs for these new data to the dataframe using predict() from car package.

Usage

1
model_predictions(model, data = NULL, label = NULL, type = "response")

Arguments

model

Name of the model that you'll use to generate predictions

data

a dataframe containing cases for predictions. Must include all regressors from model. Default is NULL with predictions returned for the current sample.

label

A string label to append to variable names for predicted values, CIs and SE. Default is NULL with no append

type

'response' or 'link'. Used only for glm objects. see predict()

Details

If Data=NULL, returns a numeric vector of predicted values for sample. If Data are provided, adds four new columns at the front of the dataframe These variables are named Predicted (prediced value), CILo (lower bound of

Value

Returns a dataframe of model predictions, standard errors, and confidence intervals.


michaelasher/glmResources documentation built on Dec. 21, 2021, 5:56 p.m.