I want to test the equality of coefficients in quantile regression model using loop. The code as follows
Code:
clear
sysuse auto
sqreg price weight length foreign, quantile(.25 .5 .75) reps(100)
local qlist "q25 q50 q75"
local shortloop "weight length"
foreach k of local qlist{
foreach fshort of local shortloop{
local expshort 0
ds `fshort'
local pp `r(varlist)'
*di "`pp'"
foreach v of local pp {
local expshort `expshort' + [`k']`v'
}
display "`expshort'"
test `expshort' /*simple example for demo*/
}
}
Code:
0 + [q25]weight 0 not found r(111);
Thanks very much!
Best regards,
wanhai you
0 Response to subset of local marco
Post a Comment