data(simData)
theta <- c(beta0=1,beta1=2)
model1 <- momentModel(y~x1, ~z1+z2, data=simData)
res <- gmmFit(model1)
meatGmm(res)
## It is a slightly different because the weighting matrix
## is computed using the first step estimate and the covariance
## matrix of the moment conditions is based on the final estimate.
## They should, however, be asymptotically equivalent.
meatGmm(res, robust=TRUE)
## TSLS
res2 <- tsls(model1)
## Robust meat
meatGmm(res2, TRUE)
## It makes no difference is the model is assumed iid
model2 <- momentModel(y~x1, ~z1+z2, data=simData, vcov="iid")
res2 <- tsls(model2)
meatGmm(res2, FALSE)
meatGmm(res2, TRUE)
Run the code above in your browser using DataLab