confint.ivreg {ivreg} | R Documentation |
Summary and Inference Methods for "ivreg"
Objects
Description
Summary method, including Wald tests and (by default) certain diagnostic tests, for
"ivreg"
model objects, as well as other related inference functions.
Usage
## S3 method for class 'ivreg'
confint(
object,
parm,
level = 0.95,
component = c("stage2", "stage1"),
complete = TRUE,
vcov. = NULL,
df = NULL,
...
)
## S3 method for class 'ivreg'
summary(object, vcov. = NULL, df = NULL, diagnostics = NULL, ...)
## S3 method for class 'summary.ivreg'
print(
x,
digits = max(3, getOption("digits") - 3),
signif.stars = getOption("show.signif.stars"),
...
)
## S3 method for class 'ivreg'
anova(object, object2, test = "F", vcov. = NULL, ...)
## S3 method for class 'ivreg'
Anova(mod, test.statistic = c("F", "Chisq"), vcov. = NULL, ...)
## S3 method for class 'ivreg'
linearHypothesis(
model,
hypothesis.matrix,
rhs = NULL,
test = c("F", "Chisq"),
vcov. = NULL,
...
)
Arguments
object , object2 , model , mod |
An object of class |
parm |
parameters for which confidence intervals are to be computed; a vector or numbers or names; the default is all parameters. |
level |
confidence level; the default is |
component |
Character indicating |
complete |
If |
vcov. |
Optionally either a coefficient covariance matrix or a function to compute such a covariance
matrix from fitted |
df |
For |
... |
arguments to pass down. |
diagnostics |
Report 2SLS "diagnostic" tests in model summary (default is |
x |
An object of class |
digits |
Minimal number of significant digits for printing. |
signif.stars |
Show "significance stars" in summary output? |
test , test.statistic |
Test statistics for ANOVA table computed by |
hypothesis.matrix , rhs |
For formulating a linear hypothesis; see the documentation
for |
See Also
ivreg
, ivreg.fit
, ivregDiagnostics
Examples
## data and model
data("CigaretteDemand", package = "ivreg")
m <- ivreg(log(packs) ~ log(rincome) | log(rprice) | salestax, data = CigaretteDemand)
## summary including diagnostics
summary(m)
## replicate global F test from summary (against null model) "by hand"
m0 <- ivreg(log(packs) ~ 1, data = CigaretteDemand)
anova(m0, m)
## or via linear hypothesis test
car::linearHypothesis(m, c("log(rincome)", "log(rprice)"))
## confidence intervals
confint(m)
## just the Wald tests for the coefficients
library("lmtest")
coeftest(m)
## plug in a heteroscedasticity-consistent HC1 covariance matrix (from sandwich)
library("sandwich")
## - as a function passing additional type argument through ...
coeftest(m, vcov = vcovHC, type = "HC1")
## - as a function without additional arguments
hc1 <- function(object, ...) vcovHC(object, type = "HC1", ...)
coeftest(m, vcov = hc1)
## - as a matrix
vc1 <- vcovHC(m, type = "HC1")
coeftest(m, vcov = vc1)
## in summary() with diagnostics = TRUE use one of the function specifications,
## the matrix is only possible when diagnostics = FALSE
summary(m, vcov = vcovHC, type = "HC1") ## function + ...
summary(m, vcov = hc1) ## function
summary(m, vcov = vc1, diagnostics = FALSE) ## matrix
## in confint() and anova() any of the three specifications can be used
anova(m0, m, vcov = vcovHC, type = "HC1") ## function + ...
anova(m0, m, vcov = hc1) ## function
anova(m0, m, vcov = vc1) ## matrix