Returns the values the response variable(s) from a model object. If the model is a multivariate response model, a data frame with values from all response variables is returned.

get_response(x, select = NULL, verbose = TRUE)

Arguments

x A fitted model. Optional name(s) of response variables for which to extract values. Can be used in case of regression models with multiple response variables. Toggle warnings.

Value

The values of the response variable, as vector, or a data frame if x has more than one defined response variable.

Examples

if (require("lme4")) {
data(cbpp)
cbpp$trials <- cbpp$size - cbpp\$incidence

m <- glm(cbind(incidence, trials) ~ period, data = cbpp, family = binomial)