Last chance! 50% off unlimited learning
Sale ends in
encomptest
performs the encompassing test of Davidson & MacKinnon
for comparing non-nested models.
encomptest(formula1, formula2, data = list(), vcov. = NULL, ...)
"lm"
."lm"
.encomptest
is called from.vcovHC
.waldtest
."anova"
which contains the residual degrees of freedom
in the encompassing model, the difference in degrees of freedom, Wald statistic
(either "F"
or "Chisq"
) and corresponding p value.
waldtest
.
For further details, see the references.
W. H. Greene (1993), Econometric Analysis, 2nd ed. Macmillan Publishing Company, New York.
W. H. Greene (2003). Econometric Analysis, 5th ed. New Jersey, Prentice Hall.
coxtest
, jtest
## Fit two competing, non-nested models for aggregate
## consumption, as in Greene (1993), Examples 7.11 and 7.12
## load data and compute lags
data(USDistLag)
usdl <- na.contiguous(cbind(USDistLag, lag(USDistLag, k = -1)))
colnames(usdl) <- c("con", "gnp", "con1", "gnp1")
## C(t) = a0 + a1*Y(t) + a2*C(t-1) + u
fm1 <- lm(con ~ gnp + con1, data = usdl)
## C(t) = b0 + b1*Y(t) + b2*Y(t-1) + v
fm2 <- lm(con ~ gnp + gnp1, data = usdl)
## Encompassing model
fm3 <- lm(con ~ gnp + con1 + gnp1, data = usdl)
## Cox test in both directions:
coxtest(fm1, fm2)
## ...and do the same for jtest() and encomptest().
## Notice that in this particular case they are coincident.
jtest(fm1, fm2)
encomptest(fm1, fm2)
## the encompassing test is essentially
waldtest(fm1, fm3, fm2)
Run the code above in your browser using DataLab