Announcement

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

  • tabstat with missings

    Hi Nick Cox, Clyde Schechter and Carlo Lazzaro,

    I am trying to build up a summary statistics table that contains traditional stats such as N, mean, median, etc. However, I want to include the percentage of missing values for each variable, as an additional column. Do you have any thought about it?

    This is my code that gives me a tex file to upload to Overleaf (latex editor):

    Code:
    foreach stat in business household finances{
        est clear
        estpost tabstat $`stat', by(treatment) listwise statistics (count mean sd p1 p25 p50 p75 p99) columns(statistics)
        ereturn list
        esttab using "$analysis_output/Draft/`stat'_sum.tex", label cells("count mean(fmt(%6.0fc)) sd(fmt(%6.2fc)) median(fmt(%6.2fc)) p1(fmt(%6.2fc)) p25(fmt(%6.2fc)) p75(fmt(%6.2fc)) p99(fmt(%6.2fc))") collabels("N" "Mean" "SD" "Percentile 1" "Percentile 25" "Percentile 50" "Percentile 75" "Percentile 99") replace
    }

  • #2
    tabstat doesn't support that as an extra statistic, so you need to write your own code I guess, possibly but not necessarily for table.

    Comment

    Working...
    X