Perform Quantilewise ADF unit root test in STATA

This module can be used if you are estimating quantile regression or Quantile ARDL in time series data. Since data do not have Quantile ADF test, this tutorial estimate ADF unit root test on different quantile positions and then plot its variations.

You can see tutorial at: https://youtu.be/hCBiHQN6-PE

clear

use “C:\Users\LENOVO\Desktop\quantile PMG model\quantile on quantile on stata\data.dta”

 

tsset time

 

xtile mal_group = mal, nq(100)

 

capture postutil clear

tempfile holding

postfile handle quantile test prob using `holding’

 

forvalues i = 1/19 {

local tau_indep = `i’ *5

dfuller malĀ  if mal_group < `tau_indep’, lags(0)

local test = r(Zt)

local prob = r(p)

display “At quantile value: ” `tau_indep’ ” test statistic: ” `test’ ” & p value: ” `prob’

post handle (`tau_indep’) (r(Zt)) (r(p))

}

 

postclose handle

use `holding’, clear

 

twoway (line test quantile) (line prob quantile, yaxis(2)), ytitle(Test Value) xtitle(Quantile Positions of Variable) title(Quantilewise ADF Unit Root Test) scheme(sj)

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top