Description Usage Arguments Details See Also Examples
Methods for computing predictions, fitted values, and residuals
from fitted enbin
objects.
1 2 3 4 5 6 7 8 | ## S3 method for class 'enbin'
predict(object, newdata = NULL,
type = c("response", "location", "scale", "parameter", "probability", "quantile"),
na.action = na.pass, at = 0.5, ...)
## S3 method for class 'enbin'
fitted(object, type = c("location", "scale"), ...)
## S3 method for class 'enbin'
residuals(object, type = c("standardized", "pearson", "response"), ...)
|
object |
an object of class |
newdata |
optionally, a data frame in which to look for variables with which to predict. If omitted, the original observations are used. |
type |
character indicating type of predictions/residuals: fitted means of
latent response ( |
na.action |
function determining what should be done with missing values
in |
at |
numeric vector indicating the level(s) at which quantiles or probabilities
should be predicted (only if |
... |
currently not used. |
In addition to the methods above, a set of standard extractor functions for
"enbin"
objects is available, see enbin
for an overview.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## extended negative binomial model for number of trips
data("RecreationDemand", package = "AER")
m <- enbin(trips ~ . - income | . - income, data = RecreationDemand)
## by default predict() and fitted() return the fitted latent means on the observed sample
head(fitted(m))
head(predict(m))
## new data
nd <- data.frame(quality = 2, ski = "yes", userfee = "yes", costC = 60, costS = 70, costH = 80)
## predictions
predict(m, newdata = nd, type = "location")
predict(m, newdata = nd, type = "scale")
predict(m, newdata = nd, type = "quantile")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.