Library: | smoother |
See also: | epa |
Quantlet: | lvtest | |
Description: | This quantlet tests for significance of a subset or of the whole set of continuous regresssors in a nonparametric regression. |
Usage: | test = lvtest(y,w,z,hw,hz) | |
Input: | ||
y | n dimensional vector | |
w | n x p matrix | |
z | n x k matrix | |
hw | p1 dimensional vector | |
hz | k dimensional vector | |
Output: | ||
test | test statistic and its P-value |
The first argument y is the vector of observations of the dependent variable. If we test for significance of a subset of regressors, the second argument w is the matrix of observations of the explanatory variables that are not under test, and the third argument z is the matrix of observations of the regressors under test. The fourth argument is the vector of bandwidths for w, the fifth argument is the vector of bandwidths for z. If we test the significance of the whole set of regressors, the second argument is the matrix of observations on this set, and the third argument is the vector of bandwidths.
In both cases, there is no default argument for the bandwidths, thus, these vectors must be supplied by the user.
The test statistic is evaluated by using the multidimensional Epanechnikov kernel. The function displays the value of the test statistic and its P-Value.
; We test here for the significance of the subset of regressors ; z. Since by construction, this subset is significant, the ; evaluated P-value is equal to zero. ; library("smoother") setenv("outputstringformat", "%s") func("diagrv") randomize(0) u = normal(100,1) w = normal(100,1) z = normal(100,1) y = w^3 - w + 2*z + u test = lvtest(y,w,z,0.4,0.4)
Contents of result [1,] Test Statistic P-Value [2,] ________________________ [3,] [4,] 5.8210 0.0000
; Here, the subset of regressors z is not significant. Thus, the ; P-value of the test is high. library("smoother") setenv("outputstringformat", "%s") func("diagrv") randomize(0) u = normal(100,1) w = normal(100,1) z = normal(100,1) y = w^3 - w + u test = lvtest(y,w,z,0.4,0.4)
Contents of result [1,] Test Statistic P-Value [2,] ________________________ [3,] [4,] 0.0735 0.4707