Hello all,
I am trying to create a graph for Quantile Regression for Panel Data. However, when I run the loop for each am not able to get the desired result because I get the error 122: invalid numlist has too few elements.
The following is my code:
local quantiles 5 10 25 50 75 90 95
local models ""
local xlabel ""
local j=1
foreach q of numlist `quantiles' {
qregpd yield_ndvi avg8_ndvi avg8_cired avg8_msavi avg8_ndre, id(fid_ndvi) fix(year_ndvi) quantile(`q')
nlcom (me_tu:_b[avg8_ndvi]+_b[avg8_cired]+_b[avg8_msavi]+_b[avg8_ndre]), post
estimates store me_tu`q'
local models `"`models' me_tu`q' || "'
local xlabel `"`xlabel' `j++' "Q{sub:`q'}""'
}
I would much appreciate it if someone could correct my code.
Best regards,
I am trying to create a graph for Quantile Regression for Panel Data. However, when I run the loop for each am not able to get the desired result because I get the error 122: invalid numlist has too few elements.
The following is my code:
local quantiles 5 10 25 50 75 90 95
local models ""
local xlabel ""
local j=1
foreach q of numlist `quantiles' {
qregpd yield_ndvi avg8_ndvi avg8_cired avg8_msavi avg8_ndre, id(fid_ndvi) fix(year_ndvi) quantile(`q')
nlcom (me_tu:_b[avg8_ndvi]+_b[avg8_cired]+_b[avg8_msavi]+_b[avg8_ndre]), post
estimates store me_tu`q'
local models `"`models' me_tu`q' || "'
local xlabel `"`xlabel' `j++' "Q{sub:`q'}""'
}
I would much appreciate it if someone could correct my code.
Best regards,
Comment