Announcement

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

  • using estout to export ttest outputs to LaTeX

    Hi everyone,
    I am using Italian Time use surveys and I am generating trends to see how time dedicated to given activities has evolved over the two surveys.
    This is a part of the code I have generated:

    * UNCONDITIONAL MEANS
    set more off
    cap rm "table.txt"
    global storelist ""

    foreach X of varlist read_total play_total homework_total/*
    */music_total meals_total sport_total social_total religious_total TOTQUALITY {
    ttest `X' if child==1, by (a2008)
    estpost ttest `X' if child==1, by (a2008)
    esttab ., cells("mu_1 mu_2 b p") noobs
    eststo `X'
    global storelist="${storelist} `X'"
    }


    * CONDITIONAL MEANS
    foreach X of varlist Cread_total Cplay_total Chomework_total/*
    */ Cmusic_total Cmeals_total Csport_total Csocial_total Creligious_total CTOTQUALITY{
    ttest `X' if child==1, by (a2008)
    estpost ttest `X' if child==1, by (a2008)
    esttab ., cells("mu_1 mu_2 b p") noobs
    eststo `X'
    global storelist="${storelist2} `X'"
    }

    estout ${storelist} ${storelist2} using table1.tex ,replace style(tex) cells("mu_1 mu_2 b p(par)") legend label varlabels(_cons \_cons)

    I have problems in exporting the results to LaTex (& Word). In particular, I do not understand why but when I use this code I get only the last result of each loop (the last for unconditional and the last for conditional means). Furthermore I would Ideally like to have all the variables in rows while the results from the conditional should be in the column next to the one of the unconditional means. Is anyone able to help me?
    thank you in advance
    Andrea
Working...
X