Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Regression rich text file issue

    Hello, I am attempting to transfer the regression to a rich text file. For some reason my regression rich text file is only posting the opened regression. Where am I messing up in my code for this? I have posted my sample from my data and code.

    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
    Data
    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

  • #2
    The output of help esttab tells us that the syntax for the esttab command is as follows.

    Syntax

    esttab [ namelist ] [ using filename ] [ , options ]

    where namelist is a name, a list of names, or _all. The * and ? wildcards are allowed in namelist. A name may also be ., meaning the current (active) estimates.
    I think you want
    Code:
    esttab _all ...

    Comment

    Working...
    X