I save my regression coefficents and standard errors by using:
Then I get a standard output statsby output as:
I first change variable names to their labels by:
Then I get the following output:
As a final step, I want to create categorical variable for each estimation, and want to add their coefficents and standard errors besides them. So each observation should have name of the coeffcient e.g. _b_904b_product_code_co_lnp_, the coefficent itself e.g. 0 and the standard error e.g. 0.
How could I do it ?
Code:
xtset product_code statsby _b _se, saving(C:\temp\temp_2.dta, replace) : xtreg lnq lnp i.product_code#c.lnp, fe vce(cluster product_code)
Then I get a standard output statsby output as:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(_stat_2 _stat_3 _stat_4 _stat_597 _stat_598 _stat_599) 0 0 -.3286103 0 0 1.3530442e-07 end
I first change variable names to their labels by:
Code:
foreach var of varlist * { local lab `: var label `var'' local lab `: di subinstr("`lab'", "[", "_", .)' local lab `: di subinstr("`lab'", "]", "_", .)' local lab `: di subinstr("`lab'", "#", "_", .)' local lab `: di subinstr("`lab'", ".", "_", .)' label var `var' "`lab'" } foreach v of varlist _all { local x : variable label `v' rename `v' `x' }
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(_b_904b_product_code_co_lnp_ _b_905o_product_code_co_lnp_ _b_906_product_code_c_lnp_ _se_904b_product_code_co_lnp_ _se_905o_product_code_co_lnp_ _se_906_product_code_c_lnp_) 0 0 -.3286103 0 0 1.3530442e-07 end
How could I do it ?
Comment