Jtest: J-test of overidentifying restrictions under local...

Description Usage Arguments Details Value References Examples

View source: R/J.R

Description

Computes J-test of overidentifying restrictions with critical value adjusted to allow for local misspecification, when the parameter c takes the form c=B*gamma with the lp norm of gamma bounded by M.

Usage

1
Jtest(eo, B, M = 1, p = 2, alpha = 0.05)

Arguments

eo

List containing initial estimates with the following components:

Sig

Estimate of variance of the moment condition, matrix with dimension d_g by d_g, where d_g is the number of moments

G

Estimate of derivative of the moment condition, matrix with dimension d_g by d_theta, where d_theta is the dimension of theta

n

sample size

g_init

Moment condition evaluated at initial estimate

B

matrix B with full rank and dimension d_g by d_gamma that determines the set \mathcal{C}, where d_gamma is the number of invalid moments, and d_g is the number of moments

M

Bound on the norm of gamma

p

Parameter determining which lp norm to use, must equal 1, 2, or Inf.

alpha

determines confidence level, 1-alpha, for constructing/optimizing confidence intervals.

Details

The test assumes initial estimator in eo is optimal under correct specification, computed using eo$Sig as the weight matrix. The test is based on a J statistic using critical values that account for local misspecification; see appendix B in Armstrong and Kolesár (2020) for details.

Value

List with three elements:

J

Value of J statistic

p0

P-value of usual J test

pC

P-value for J-test that allows for local misspecification

Mmin

Minimum value of M for which the J-test does not reject

References

Armstrong, T. B., and M. Kolesár (2020): Sensitivity Analysis Using Approximate Moment Condition Models, https://arxiv.org/abs/1808.07387

Examples

1
2
3
4
5
6
7
8
9
## Replicates first line of Table 1 in Armstrong and Kolesár (2020)
## 1. Compute matrix B when instrument D/F # cars is invalid
I <- vector(mode="logical", length=nrow(blp$G))
I[6] <- TRUE
B <- (blp$ZZ %*% diag(sqrt(blp$n)*abs(blp$perturb)/blp$sdZ))[, I, drop=FALSE]
## 2. Make sure Sig corresponds to inverse of weight matrix
eo <- list(G=blp$G, Sig=solve(blp$W), n=blp$n, g_init=blp$g_init)
Jtest(eo, B, M=1, p=2, alpha=0.05)
Jtest(eo, B, M=1, p=Inf, alpha=0.05)

kolesarm/GMMSensitivity documentation built on Sept. 17, 2020, 5:47 p.m.