Code
Code:
**Example for regression create rich text files set more off foreach var in opened clicked Totalclicks survey { reg `var' social_treatment i.strata if faculty==1 & g1=="F", r estimates save facultyfemale`var'_reg.ster, replace reg `var' social_treatment i.strata if faculty==1 & g1=="M", r estimates save facultymale`var'_reg.ster, replace reg `var' social_treatment i.strata if student==1 & g1=="F", r estimates save studentfemale`var'_reg.ster, replace reg `var' social_treatment i.strata if student==1 & g1=="M", r estimates save studentmale`var'_reg.ster, replace } estimates drop _all foreach var in opened clicked Totalclicks survey { estimates use facultyfemale`var'_reg.ster eststo } esttab . using facultyfemale`var'_reg.rtf, keep(social_treatment) /// nonumber varwidth(25) onecell noobs nogaps nodep label b(%5.3f) /// se(%5.3f) star(+ 0.10 * 0.05 ** 0.01) /// compress scalars("N Nb. of Observations") /// sfmt(%10.0fc %10.0fc %10.0fc %10.3fc) /// mlabels("(1)" "(2)" "(3)" "(4)") /// mgroups("opened" "clicked" "totalclicks" "survey", pattern(1 1 1 1 )) /// eqlabels(none) replace estimates drop _all foreach var in opened clicked Totalclicks survey { estimates use facultymale`var'_reg.ster eststo } esttab . using facultymale`var'_reg.rtf, keep(social_treatment) /// nonumber varwidth(25) onecell noobs nogaps nodep label b(%5.3f) /// se(%5.3f) star(+ 0.10 * 0.05 ** 0.01) /// compress scalars("N Nb. of Observations") /// sfmt(%10.0fc %10.0fc %10.0fc %10.3fc) /// mlabels("(1)" "(2)" "(3)" "(4)") /// mgroups("opened" "clicked" "totalclicks" "survey", pattern(1 1 1 1 )) /// eqlabels(none) replace estimates drop _all foreach var in opened clicked Totalclicks survey { estimates use studentfemale`var'_reg.ster eststo } esttab . using studentfemale_reg.rtf, keep(social_treatment) /// nonumber varwidth(25) onecell noobs nogaps nodep label b(%5.3f) /// se(%5.3f) star(+ 0.10 * 0.05 ** 0.01) /// compress scalars("N Nb. of Observations") /// sfmt(%10.0fc %10.0fc %10.0fc %10.3fc) /// mlabels("(1)" "(2)" "(3)" "(4)") /// mgroups("opened" "clicked" "total clicks" "survey", pattern(1 1 1 1 )) /// eqlabels(none) replace estimates drop _all foreach var in opened clicked Totalclicks survey { estimates use facultymale`var'_reg.ster eststo } esttab . using studentmale_reg.rtf, keep(social_treatment) /// nonumber varwidth(25) onecell noobs nogaps nodep label b(%5.3f) /// se(%5.3f) star(+ 0.10 * 0.05 ** 0.01) /// compress scalars("N Nb. of Observations") /// sfmt(%10.0fc %10.0fc %10.0fc %10.3fc) /// mlabels("(1)" "(2)" "(3)" "(4)") /// mgroups("opened" "clicked" "total clicks" "survey", pattern(1 1 1 1 )) /// eqlabels(none) replace exit
Code:
clear input byte(social_treatment Totalclicks) float(opened survey clicked) str1 g1 float faculty 1 0 0 0 0 "F" 1 1 0 0 0 0 "F" 1 1 0 0 0 0 "F" 1 1 0 0 0 0 "F" 1 1 0 0 0 0 "F" 1 1 0 1 0 0 "F" 1 1 0 0 0 0 "F" 1 0 0 1 0 0 "F" 1 0 0 1 0 0 "F" 1 0 0 0 0 0 "F" 1 0 0 1 0 0 "F" 1 0 0 0 0 0 "F" 1 0 0 0 0 0 "F" 1 1 1 1 0 1 "M" 1 1 0 0 0 0 "M" 1 1 2 1 0 1 "M" 1 1 0 0 0 0 "M" 1 1 0 0 0 0 "M" 1 1 0 1 0 0 "M" 1 1 0 0 0 0 "M" 1 1 0 1 0 0 "M" 1 0 0 1 0 0 "M" 1 0 0 1 0 0 "M" 1 0 0 0 0 0 "M" 1 0 0 0 0 0 "M" 1 0 0 1 0 0 "M" 1 0 0 1 0 0 "M" 1 0 0 0 0 0 "M" 1 0 0 1 0 0 "M" 1
0 Response to Regression rich text file issue
Post a Comment