Hi Statalisters
I am trying to save the elasticities that are generated by Brian Poi (2012) "quaids" command as separate variables.
To be specific, I want the elasticites in the price elasticities matrix to be saved as unique variables such as row 1, column 1 elasticity as one variable and row 1 column 2 as another variable etc.
Saving the variables in the following way, gives me unique columns only so that I have 4 separate variables (col1 col2 col3 and col4) but not 16 separate variables which I want.
Any suggestions?
Thank you in advance
Mariko Wijekoon
clear
webuse food
quaids w1-w4, anot(10) lnprices(lnp1-lnp4) expenditure(expfd)
*Calculate observation-level predicted expenditure shares and elasticities
predict what*
estat expenditure mu*
estat compensated ce*
estat uncompensated ue*
*Calculate elasticities and standard errors at variable means
estat expenditure, atmeans
matrix list r(expelas)
mat expend=r(expelas)
svmat double expend, names(matcol)
*
estat compensated, atmeans
matrix list r(compelas)
mat pricec =r(compelas)
svmat double pricec, names(matcol)
*
estat uncompensated, atmeans
matrix list r(uncompelas)
mat u =r(uncompelas)
svmat double u, names(matcol)
I am trying to save the elasticities that are generated by Brian Poi (2012) "quaids" command as separate variables.
To be specific, I want the elasticites in the price elasticities matrix to be saved as unique variables such as row 1, column 1 elasticity as one variable and row 1 column 2 as another variable etc.
Saving the variables in the following way, gives me unique columns only so that I have 4 separate variables (col1 col2 col3 and col4) but not 16 separate variables which I want.
Any suggestions?
Thank you in advance
Mariko Wijekoon
clear
webuse food
quaids w1-w4, anot(10) lnprices(lnp1-lnp4) expenditure(expfd)
*Calculate observation-level predicted expenditure shares and elasticities
predict what*
estat expenditure mu*
estat compensated ce*
estat uncompensated ue*
*Calculate elasticities and standard errors at variable means
estat expenditure, atmeans
matrix list r(expelas)
mat expend=r(expelas)
svmat double expend, names(matcol)
*
estat compensated, atmeans
matrix list r(compelas)
mat pricec =r(compelas)
svmat double pricec, names(matcol)
*
estat uncompensated, atmeans
matrix list r(uncompelas)
mat u =r(uncompelas)
svmat double u, names(matcol)
Comment