| summary.ivreg {AER} | R Documentation |
Methods to standard generics for instrumental-variable regressions
fitted by ivreg.
## S3 method for class 'ivreg':
summary(object, vcov. = NULL, df = NULL, ...)
## S3 method for class 'ivreg':
anova(object, object2, test = "F", vcov = NULL, ...)
## S3 method for class 'ivreg':
terms(x, component = c("regressors", "instruments"), ...)
## S3 method for class 'ivreg':
model.matrix(object, component = c("projected", "regressors", "instruments"), ...)
object, object2, x |
an object of class "ivreg" as fitted by
ivreg. |
vcov., vcov |
a specification of the covariance matrix of the estimated coefficients. This can be specified as a matrix or as a function yielding a matrix when applied to the fitted model. |
df |
the degrees of freedom to be used. By default this is set to
residual degrees of freedom for which a t or F test ist computed. Alternatively,
it can be set to Inf (or equivalently 0) for which a z or Chi-squared
test is computed. |
test |
character specifying wether to compute the large sample Chi-squared statistic (with asymptotic Chi-squared distribution) or the finite sample F statistic (with approximate F distribution). |
component |
character specifying for which component of the
terms or model matrix should be extracted. "projected" gives the matrix of
regressors projected on the image of the instruments. |
... |
currently not used. |
ivreg is the high-level interface to the work-horse function ivreg.fit,
a set of standard methods (including summary, vcov, anova,
hatvalues, predict, terms, model.matrix, bread,
estfun) is available.
## data
data("CigarettesSW")
CigarettesSW$rprice <- with(CigarettesSW, price/cpi)
CigarettesSW$rincome <- with(CigarettesSW, income/population/cpi)
CigarettesSW$tdiff <- with(CigarettesSW, (taxs - tax)/cpi)
## model
fm <- ivreg(log(packs) ~ log(rprice) + log(rincome) | log(rincome) + tdiff + I(tax/cpi),
data = CigarettesSW, subset = year == "1995")
summary(fm, vcov = sandwich, df = Inf)
## ANOVA
fm2 <- ivreg(log(packs) ~ log(rprice) | tdiff, data = CigarettesSW, subset = year == "1995")
anova(fm, fm2, vcov = sandwich, test = "Chisq")