get_predict: Get predicted values from a model object (internal function)

Description Usage Arguments Value

Description

Get predicted values from a model object (internal function)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
get_predict(model, newdata, type, ...)

## Default S3 method:
get_predict(model, newdata = insight::get_data(model), type = "response", ...)

## S3 method for class 'polr'
get_predict(
  model,
  newdata = insight::get_data(model),
  type = "response",
  group_name = "1",
  ...
)

## S3 method for class 'crch'
get_predict(model, newdata = NULL, type = "location", ...)

## S3 method for class 'multinom'
get_predict(
  model,
  newdata = insight::get_data(model),
  type = "response",
  group_name = "1",
  ...
)

## S3 method for class 'clm'
get_predict(
  model,
  newdata = insight::get_data(model),
  type = "response",
  group_name = NULL,
  ...
)

Arguments

model

Model object

newdata

A dataset over which to compute marginal effects. NULL uses the original data used to fit the model.

type

Type(s) of prediction as string or vector This can differ based on the model type, but will typically be a string such as: "response", "link", "probs", or "zero".

...

Additional arguments are pushed forward to predict().

Value

A vector of predicted values of length equal to the number of rows in newdata. For models with multi-level outcomes (e.g., multinomial logit), this function returns a matrix of predicted values with column names equal to each of the levels/groups.


marginaleffects documentation built on Oct. 19, 2021, 1:09 a.m.