Announcement

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

  • Exporting matrix to Latex with brackets

    Hello, I am having trouble figuring out how to export a matrix to Latex using esttab so that each entry of the matrix is encompassed in brackets.

    Best, Marta

    matrix pval = J(1, 5, .)
    local i = 0

    foreach num of numlist 1970(10)2010 {
    local i = `i' + 1
    summarize temp if Decade == `num', d
    local t1m `r(mean)'
    local t1s `r(sd)'
    local t1n `r(N)'

    summarize temp if Decade == `num' [aw=media], d
    local t2m `r(mean)'
    local t2s `r(sd)'
    local t2n `r(N)'

    ttesti `t1n' `t1m' `t1s' `t2n' `t2m' `t2s'
    matrix pval[1, `i'] = `r(p)'

    }

    esttab matrix(pval, fmt(%12.3f)) using "results.tex", replace label gap noobs nonumber nomtitles collabels(none) nonote varlabels( , elist(r1 \addlinespace\addlinespace))
Working...
X