I run code "
capture postutil clear
tempfile holding
postfile handle quantile coefficient lb ub using `holding'
forvalues i=1/9 {
local ii = `i'/10
qregpd d_ta def def_sqrt, quantile(`ii') id(id_firm) fix(year) optimize(mcmc) draws(1000) burn(500) arate(0.5)
matrix M = r(table)
post handle (`ii') (_b[def]) (M[1, 5]) (M[1,6])
}
postclose handle
use `holding', clear
graph twoway connected coefficient lb ub quantile" and get the graph. But when want to combine the coefficient from quantile regression from qregpd and the coefficient from OLS like Dwi Utami, I run your edited code
"capture postutil clear
tempfile holding
postfile handle quantile coefficient lb ub using `holding'
forvalues i=1/9 {
local ii = `i'/10
qregpd d_ta def def_sqrt, quantile(`ii') id(id_firm) fix( year) optimize(mcmc) draws(1000) burn(500) arate(0.5)
matrix M = r(table)
post handle (`ii') (_b[def]) (M[1, 5]) (M[1,6])
}
postclose handle
regress d_ta def def_sqrt
gen ols_coeff = _b[def]
label var lb "lower limits"
label var ub "upper limits"
label var coefficient "beta"
label var ols_coef "ols"
use `holding', clear
graph twoway connected coefficient lb ub ols_coeff quantile"
But I just get the result of regression qregpd and ols. Stata says that " label var lb "lower limits"
variable lb not found
r(111);
.
. label var ub "upper limits"
variable ub not found
r(111);
.
. label var coefficient "beta"
variable coefficient not found
r(111);
.
. label var ols_coef "ols"
.
.
.
. use `holding', clear
.
. graph twoway connected coefficient lb ub ols_coeff quantile
variable ols_coeff not found
r(111)"
And one more thing, each time I run your code, I have to import data again.
I really do not know why, and I tried it many times, but the results still same,
So sorry for my stupid question.
Best regard,
Comment