kinktest: Testing the kink effect

View source: R/test kink.r

kinktestR Documentation

Testing the kink effect

Description

Hypothesis testing for kink point in kink regression. The null hyphothesis is linear regression against the alternative hyphothesis of kink regression.

Usage

kinktest(y,x,level=0.90, boot=10,search=0.01, LB)

Arguments

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

Details

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.

Value

Wald.test

Wald statistic

p-value

p-value

Author(s)

Woraphon Yamaka

References

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.

Examples

#### 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)

woraphonyamaka/Kinkreg documentation built on Aug. 15, 2022, 4:17 a.m.