kinktest | R Documentation |
Hypothesis testing for kink point in kink regression. The null hyphothesis is linear regression against the alternative hyphothesis of kink regression.
kinktest(y,x,level=0.90, boot=10,search=0.01, LB)
y |
the vector of dependent variable |
x |
the matrix of regime-dependent independent variable |
level |
Confidence interval |
boot |
number of boostrapping |
search |
range of grid search |
LB |
lower and upper bound restriction |
As shown by Hansen (1996), it is simple to simulate approximations using a multiplier bootstrap, and thus asymptotically valid p-values can be calculated. The following is his recommended algorithm. (Theorem 3 of Hansen (1996) shows that the algorithm produces asymptotically first-order correct p-values under the conditions of Theorem 1.
Wald.test |
Wald statistic |
p-value |
p-value |
Woraphon Yamaka
Hansen, B. E. (1996). Inference when a nuisance parameter is not identified under the null hypothesis. Econometrica: Journal of the econometric society, 413-430.
Hansen, B. E. (2017). Regression kink with an unknown threshold. Journal of Business & Economic Statistics, 35(2), 228-240.
#### Example Simulation data # Ho: Linear # Ha: Kink set.seed(111) # Set seed for reproducibility k = 1 #number of dependent variable n = 500 #number of observation r1=1.5 # Kink parameter x = rnorm(n,r1,sd=1) e = rnorm(n,0,sd=1) x1 = cbind(neg.part(x-r1),pos.part(x-r1)) y=0.5+(0.5*x1[,1])-(1*x1[,2])+e kinktest(y,x,level=0.90, boot=10,search=0.01,LB=0.01)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.