Announcement

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

  • Multiline model name for long variable names using esttab

    Hi users,

    I am using esttab to generate tables in Latex. I have long model name that I want to appear in two lines because if I keep them in one line it pushes the last column out of the table frame. Here is my code:

    Code:
    esttab high low diff Total , ///
    cells("mean(pattern(1 1 0 1) fmt(2)) b(star pattern(0 0 1 0) fmt(2))") ///
    label mlabels("Mean treated three or more times" "Mean treated one or two times" "Diff" "Total") ///
    collabels(none) replace
    This produces the following table for me:

    Code:
    ---------------------------------------------------------------------------
                                  (1)          (2)          (3)             (4)
                         Mean treat~s Mean treat~s         Diff           Total
    ---------------------------------------------------------------------------
    Teacher with highe~e         0.12         0.11        -0.01            0.11
    Teacher per student          2.64         2.24        -0.40            2.40
    Avg class size              37.98        38.38         0.40           38.23
    Total enrollment           510.48       569.82        59.34          546.52
    Total female enrol~t       124.76       216.54        91.78*         180.51
    Number of students~o        99.10       109.23        10.14          105.25
    School age                  22.71        22.02        -0.70           22.29
    Number of shifts             1.71         1.86         0.15            1.80
    Average score at t~e       202.50       195.61        -6.89          198.31
    ---------------------------------------------------------------------------
    Observations                   42           65          107             107
    ---------------------------------------------------------------------------
    You see that name in columns 1 and 2 are long and that results in pushing column 4 out. I need to split the names in columns 1 and 2 into two parts that come in two rows. I appreciate if anyone can help me with that.

  • #2
    For LaTeX tables only:

    Code:
    mtitle("\shortstack{\textbf{Mean treated three}\\or more times}" "\shortstack{\textbf{Mean treated one}\\or two times}" "Diff" "Total")

    Comment

    Working...
    X