Methods for Instrumental-Variable Regression
summary.ivreg.RdMethods to standard generics for instrumental-variable regressions
fitted by ivreg.
Usage
# S3 method for class 'ivreg'
summary(object, vcov. = NULL, df = NULL, diagnostics = FALSE, ...)
# 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"), ...)Arguments
- object, object2, x
an object of class
"ivreg"as fitted byivreg.- 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. If it is a function it is also employed in the two diagnostic F tests (if
diagnostics = TRUEin thesummary()method).- 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 is computed. Alternatively, it can be set to
Inf(or equivalently0) for which a z or Chi-squared test is computed.- diagnostics
logical. Should diagnostic tests for the instrumental-variable regression be carried out? These encompass an F test of the first stage regression for weak instruments, a Wu-Hausman test for endogeneity, and a Sargan test of overidentifying restrictions (only if there are more instruments than regressors).
- test
character specifying whether 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.
Details
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, update, bread,
estfun) is available.
See also
ivreg, lm.fit
Examples
## data
data("CigarettesSW")
CigarettesSW <- transform(CigarettesSW,
rprice = price/cpi,
rincome = income/population/cpi,
tdiff = (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)
#>
#> Call:
#> ivreg(formula = log(packs) ~ log(rprice) + log(rincome) | log(rincome) +
#> tdiff + I(tax/cpi), data = CigarettesSW, subset = year ==
#> "1995")
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -0.6006931 -0.0862222 -0.0009999 0.1164699 0.3734227
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 9.8950 1.0586 9.348 4.12e-12 ***
#> log(rprice) -1.2774 0.2632 -4.853 1.50e-05 ***
#> log(rincome) 0.2804 0.2386 1.175 0.246
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Residual standard error: 0.1879 on 45 degrees of freedom
#> Multiple R-Squared: 0.4294, Adjusted R-squared: 0.4041
#> Wald test: 13.28 on 2 and 45 DF, p-value: 2.931e-05
#>
summary(fm, vcov = sandwich, df = Inf, diagnostics = TRUE)
#>
#> Call:
#> ivreg(formula = log(packs) ~ log(rprice) + log(rincome) | log(rincome) +
#> tdiff + I(tax/cpi), data = CigarettesSW, subset = year ==
#> "1995")
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -0.6006931 -0.0862222 -0.0009999 0.1164699 0.3734227
#>
#> Coefficients:
#> Estimate Std. Error z value Pr(>|z|)
#> (Intercept) 9.8950 0.9288 10.654 < 2e-16 ***
#> log(rprice) -1.2774 0.2417 -5.286 1.25e-07 ***
#> log(rincome) 0.2804 0.2458 1.141 0.254
#>
#> Diagnostic tests:
#> df1 df2 statistic p-value
#> Weak instruments 2 44 228.738 <2e-16 ***
#> Wu-Hausman 1 44 3.823 0.0569 .
#> Sargan 1 NA 0.333 0.5641
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Residual standard error: 0.1879 on Inf degrees of freedom
#> Multiple R-Squared: 0.4294, Adjusted R-squared: 0.4041
#> Wald test: 34.51 on 2 DF, p-value: 3.214e-08
#>
## ANOVA
fm2 <- ivreg(log(packs) ~ log(rprice) | tdiff, data = CigarettesSW, subset = year == "1995")
anova(fm, fm2, vcov = sandwich, test = "Chisq")
#> Wald test
#>
#> Model 1: log(packs) ~ log(rprice) + log(rincome) | log(rincome) + tdiff +
#> I(tax/cpi)
#> Model 2: log(packs) ~ log(rprice) | tdiff
#> Res.Df Df Chisq Pr(>Chisq)
#> 1 45
#> 2 46 -1 1.3011 0.254