Announcement

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

  • Table Creation: Creating Multiple Row Variable Headers

    Hi all,

    I am using esttab to create tables in Stata and rendering them in latex and want to split an mgroups variable header so that it is stretched across two rows (i.e. basically creating two mgroups). This is so I can create a table that looks like this:

    Screenshot am 30-09 um 2019 im Preview.png

    Since I haven't been able to figure out how to do this, I have for now combined the two 'subject type' and 'teacher gender' heading row, in the above table, into a single row using the following command:

    esttab Classics_M_M Classics_F_M Classics_M_F Classics_F_F Science_M_M Science_F_M Science_M_F Science_F_F EScience_M_M EScience_F_M EScience_M_F EScience_F_F using "$dir/Graphs_Tables/tableA17.tex", p stats(N fixed1 fixed2 fixed3 fixed4 fixed5 fixed6 fixed7 fixed8, fmt(%9.0gc) labels("\vspace{0.7em} Observations \vspace{0.7em}" "Teacher Characteristics" "Previous Year Test Scores" "Grade FE" "Year FE" "Track FE" "Subject FE" "Class FE" "Student FE")) mlabels(Male Female Male Female Male Female Male Female Male Female Male Female, begin(Student Gender)) varlabels(tv "Teacher VA") mgroups("Classics Male" "Classics Female" "Science Male" "Science Female" "Exact Science Male" "Exact Science Female", pattern(1 0 1 0 1 0 1 0 1 0 1 0) begin(Subject and Teacher Gender) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) f nomtitles booktabs drop(experience lag_mod _cons) nolines posthead(\midrule) replace

    I have tried things like using two mgroups() commands and including "\par" in the titles to split them on two rows but no luck! I am hoping someone on here has an idea!

    Thank you,

    Nicholas

  • #2
    Cross-posted at https://stackoverflow.com/questions/...riable-headers

    Please note our policy on cross-posting, which is that you are asked to tell us about it. That's in the FAQ Advice.

    Comment

    Working...
    X