View source: R/residuals.snreg.R
| residuals.snreg | R Documentation |
residuals.snreg is the S3 method for extracting residuals from a fitted
snreg model. Residuals may be returned either for the full data or only
for the estimation sample.
## S3 method for class 'snreg'
residuals(object, esample = TRUE, ...)
object |
an object of class |
esample |
logical. If |
... |
additional arguments (currently unused). |
Extract Residuals from an snreg Model
This method simply accesses the obj$resid component of a fitted
"snreg" object. An informative error is produced if residuals are not
available.
A numeric vector of residuals.
If esample = TRUE, the vector matches the length of the original data
and contains NA for non-estimation observations.
If esample = FALSE, only the computed residuals are returned.
snsf, snreg, lm.mle, vcov.snreg, coef.snreg
library(snreg)
data("banks07")
head(banks07)
# Translog cost function specification
spe.tl <- log(TC) ~ (log(Y1) + log(Y2) + log(W1) + log(W2))^2 +
I(0.5 * log(Y1)^2) + I(0.5 * log(Y2)^2) +
I(0.5 * log(W1)^2) + I(0.5 * log(W2)^2)
# Specification 1: homoskedastic noise and skewness
formSV <- NULL # variance equation; constant variance
formSK <- NULL # skewness equation; constant skewness
m1 <- snreg(
formula = spe.tl,
data = banks07,
ln.var.v = formSV,
skew.v = formSK
)
residuals(m1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.