get_response | R Documentation |
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, ...)
## Default S3 method:
get_response(
x,
select = NULL,
as_proportion = TRUE,
source = "environment",
verbose = TRUE,
...
)
## S3 method for class 'nestedLogit'
get_response(x, dichotomies = FALSE, source = "environment", ...)
x |
A fitted model. |
... |
Currently not used. |
select |
Optional name(s) of response variables for which to extract values. Can be used in case of regression models with multiple response variables. |
as_proportion |
Logical, if |
source |
String, indicating from where data should be recovered. If
|
verbose |
Toggle warnings. |
dichotomies |
Logical, if model is a |
The values of the response variable, as vector, or a data frame if
x
has more than one defined response variable.
data(cbpp)
cbpp$trials <- cbpp$size - cbpp$incidence
dat <<- cbpp
m <- glm(cbind(incidence, trials) ~ period, data = dat, family = binomial)
head(get_response(m))
get_response(m, select = "incidence")
data(mtcars)
m <- lm(mpg ~ wt + cyl + vs, data = mtcars)
get_response(m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.