Comparing data which is sensitive to distribution position require use of quantile wise regression analysis but very few studies have provided the statistical reasoning for the use of quantile regression. This blog addressed this need using STATA, where you can assess the quantile wise association between the variables and if it is changing it will hint that the relations would also change across distribution.
Following are the codes:
clear
use “C:\Users\LENOVO\Desktop\qantile PMG model\quantile on quantile on stata\data.dta”
tsset time
capture xtile mal_group = mal, nq(100)
cd “C:\Users\LENOVO\Downloads”
capture postutil clear
tempfile holding
postfile handle quantile test using `holding’
forvalues i = 1/19 {
local tau_indep = `i’ *5
corr mal pak if mal_group < `tau_indep’
mat M = r(C)
local test = M[2,1]
display “At quantile value: ” `tau_indep’ ” Correlation: ” M[2,1]
post handle (`tau_indep’) (M[2,1])
}
postclose handle
use `holding’, clear
twoway (line test quantile) , ytitle(Correlation) xtitle(Quantile Positions of Variable) title(Quantilewise Correlations) scheme(sj)