Description Usage Arguments Details See Also Examples
Methods for computing predictions, fitted values, and residuals
from fitted fgamma
objects.
1 2 3 4 5 6 7 8 | ## S3 method for class 'fgamma'
predict(object, newdata = NULL,
type = c("response", "mu", "sigma", "parameter", "probability", "quantile"),
na.action = na.pass, at = 0.5, ...)
## S3 method for class 'fgamma'
fitted(object, type = c("mu", "sigma"), ...)
## S3 method for class 'fgamma'
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
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
"fgamma"
objects is available, see fgamma
for an overview.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## full gamma regression model for averge hourly earnings
data("Wages", package = "fgamma")
f1 <- fgamma(wage ~ educ + exper + tenure + sex + marriage |
tenure, data = Wages)
## by default predict() and fitted() return the fitted means on the observed sample
head(fitted(f1))
head(predict(f1))
## new data with fixed education, experience, tenure, sex, marriage (all at median) and varying tenure (over observed range)
nd <- data.frame(educ = 12, exper = 13.5,sex = "Male", marriage = "Married", tenure = 0:44)
## prediction for mu and sigma (or both)
predict(f1, newdata = nd, type = "mu")
predict(f1, newdata = nd, type = "sigma")
predict(f1, newdata = nd, type = "parameter")
## median
predict(f1, newdata = nd, type = "quantile", at = 0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.