KTest.RdThe test is proposed by Kleibergen (2005). It is robust to weak identification.
KTest(obj, theta0 = NULL, alphaK = 0.04, alphaJ = 0.01)
# S3 method for class 'gmmTests'
print(x, digits = 5, ...)Object of class "gmm" returned by gmm
The null hypothesis being tested. See details.
The size of the J and K tests when combining the two. The overall size is alphaK+alphaJ.
An object of class gmmTests returned by KTest
The number of digits to be printed
Other arguments when print is applied to another class object
The function produces the J-test and K-statistics which are robust to weak identification. The test is either \(H0:\theta=theta_0\), in which case theta0 must be provided, or \(\beta=\beta_0\), where \(\theta=(\alpha', \beta')'\), and \(\alpha\) is assumed to be identified. In the latter case, theta0 is NULL and obj is a restricted estimation in which \(\beta\) is fixed to \(\beta_0\). See gmm and the option "eqConst" for more details.
Tests and p-values
Keibergen, F. (2005), Testing Parameters in GMM without assuming that they are identified. Econometrica, 73, 1103-1123,
library(mvtnorm)
sig <- matrix(c(1,.5,.5,1),2,2)
n <- 400
e <- rmvnorm(n,sigma=sig)
x4 <- rnorm(n)
w <- exp(-x4^2) + e[,1]
y <- 0.1*w + e[,2]
h <- cbind(x4, x4^2, x4^3, x4^6)
g3 <- y~w
res <- gmm(g3,h)
# Testing the whole vector:
KTest(res,theta0=c(0,.1))
#>
#> Test robust to weak identification
#> **********************************
#>
#> The Null Hypothesis
#> (Intercept) = 0
#> w = 0.1
#>
#> K statistics
#> Test: 0.15781 ( Chi_sq with 2 degrees of freedom )
#> P-value: 0.92413
#>
#> J statistics
#> Test: 4.86692 ( Chi_sq with 3 degrees of freedom )
#> P-value: 0.18181
#>
#> S statistics
#> Test: 5.02473 ( Chi_sq with 5 degrees of freedom )
#> P-value: 0.41287
#>
#> KJ-test result: We do not reject H0 (alphaJ = 0.01, alphaK = 0.04)
# Testing a subset of the vector (See \code{\link{gmm}})
res2 <- gmm(g3, h, eqConst=matrix(c(2,.1),1,2))
res2
#> Method
#> twoStep (with equality constraints)
#>
#> Objective function value: 0.01276702
#>
#> (Intercept)
#> 0.016878
#>
#> #### Equality constraints ####
#> w = 0.1
#> ##############################
#>
KTest(res2)
#>
#> Test robust to weak identification
#> **********************************
#>
#> The Null Hypothesis
#> w = 0.1
#>
#> K statistics
#> Test: 0.04679 ( Chi_sq with 1 degrees of freedom )
#> P-value: 0.82875
#>
#> J statistics
#> Test: 4.86565 ( Chi_sq with 3 degrees of freedom )
#> P-value: 0.18190
#>
#> S statistics
#> Test: 4.91244 ( Chi_sq with 4 degrees of freedom )
#> P-value: 0.29640
#>
#> KJ-test result: We do not reject H0 (alphaJ = 0.01, alphaK = 0.04)