Extract the response variable from a fitted model on the
original or link scale.
Usage
getY(mod, data = NULL, link = FALSE, ...)
Arguments
mod
A fitted model object, or a list or nested list of such objects.
data
An optional dataset used to first re-fit the model(s).
link
Logical. If TRUE, return the GLM response variable on the
link scale (see Details).
...
Arguments to glt (not including family, which is
determined from mod).
Value
A numeric vector comprising the response variable on the original or
link scale, or an array, list of vectors/arrays, or nested list.
Details
getY will return the response variable from a model by
summing the fitted values and the response residuals. If link = TRUE
and the model is a GLM, the response is returned on the link scale. If this
results in undefined values, it is replaced by an estimate based on the
'working' response variable of the GLM (see glt).
# NOT RUN {## All SEM responses (original scale)getY(Shipley.SEM)
## Estimated response in link scale from binomial modelgetY(Shipley.SEM$Live, link = TRUE)
# }