Learn R Programming

MultiKink (version 0.1.0)

kinkTest: Test the existence of kink effect in the multi-kink quantile regression

Description

This function is used to calculate the score test statistics and its asymptotical p-value is obtained by using wild bootstrap.

Usage

kinkTest(y,thre.x,cont.z,tau,NB=200,sparsity="nid",
                     bandwidth_type="Hall-Sheather")

Value

A list with the elements

Tn

The statistic based on original data.

Tn.NB

The statistics by wild bootstrap.

pv

The p-value by wild bootstrap.

Arguments

y

A vector of response.

thre.x

A scalar covariate with threshold effect.

cont.z

A vector of covariates with constant slopes.

tau

A given quantile level belongs to (0,1).

NB

Resampling times, 200 for default.

sparsity

The error term type. Specify one from "iid" and "nid". Default is "nid".

bandwidth_type

The bandwidth type. Specify one from "Hall-Sheather","Bofinger","Chamberlain". Default is "Hall-Sheather".

Author

Chuang Wan

References

Wei Zhong, Chuang Wan and Wenyang Zhang. (2020) Estimation and inference for multi-kink quantile regression. working paper.

Examples

Run this code
ptm <- proc.time()
##Simulated data
set.seed(123)
n <- 500
tau <- 0.5
x <- runif(n,-5,5)
z <- rnorm(n,1,1)
e <- rnorm(n,0,1)-qnorm(tau,0,1)
y <- 1+x-0.5*pmax(x-2,0)+z+e
obj <- kinkTest(y, x, z, tau, NB = 200,sparsity="nid",bandwidth_type="Hall-Sheather")
proc.time() - ptm

Run the code above in your browser using DataLab