specTest-methods: ~~ Methods for Function 'specTest' in Package 'gmm4' ~~

Description Usage Arguments Methods References Examples

Description

It computes tests of specification for GMM fit.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S4 method for signature 'gmmfit,missing'
specTest(object, which, df.adj=FALSE, wObj=NULL)

## S4 method for signature 'sgmmfit,missing'
specTest(object, which, df.adj=FALSE, wObj=NULL)

## S4 method for signature 'gmmfit,numeric'
specTest(object, which)

## S4 method for signature 'gelfit,missing'
specTest(object, which,
                    type = c("All", "LR", "LM", "J"))

Arguments

object

GMM or GEL fit object

which

Which sub-moment conditions to test.

df.adj

Should we adjust the covariance matrix of the moment conditions for degrees of freedom. If TRUE the covariance matrix is multiplied by n/(n-k), where n is the sample size and k is the number of coefficients. For heteroscedastic robust covariance matrix, adjusting is equivalent to computing HC1 while not adjusting is HC0.

wObj

An object of class gmmWeights. If NULL (the recommended value), the optimal weights is computed at the fitted coefficient estimates. It is used by hypothesisTest if one wants the LR statistics to be computed using the same weights for the restricted and unrestricted model.

type

For GEL, three specification tests are available

Methods

signature(object = "gmmfit", which="missing")
signature(object = "sgmmfit", which="missing")
signature(object = "gmmfit", which="numeric")

References

Eichenbaum, M. and Hansen L. and Singleton, K. (1985). A time Series Analysis of Representative Agent Models of Consumption and Leisure Choise under Uncertainty. Quarterly Journal of Economics, 103, 51–78.

Hayashi, F. (2000). Econometrics, New Jersey: Princeton University Press.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(simData)
model1 <- gmmModel(y~x1, ~z1+z2, data=simData)

res <- modelFit(model1)
specTest(res)

## Hayashi Example 3.3 (there is not result in the book but
## that's how we would do it for YEAR=1967
data(Griliches)
dat <- subset(Griliches, YEAR==67)
model <- gmmModel(LW~S+EXPR+IQ, ~S+EXPR+AGE+MED, data=dat, vcov="MDS")
res <- modelFit(model)
## testing the orthogonality conditions of S
specTest(res, 2)

gmm4 documentation built on Dec. 6, 2019, 3:01 a.m.