Announcement

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

  • Different number of decimals for different scalars in esttab

    Hello!

    I am adding several scalars to my regression table and want different numbers of decimals for different scalars. Is there a way to do so?
    Right now I am using "sfmt(%9.0fc)" which gives 0 decimals for all my added scalars.

    Thanks a lot for helping!

    Best,
    Louise


    My current code:

    * Regression
    eststo: rdrobust `var' sdate, c(0)
    estadd scalar SE = e(se_tau_cl), replace
    estadd scalar Obs = e(N_h_r) + e(N_h_l), replace
    estadd scalar Bandwidth = e(h_r), replace

    * Table
    esttab using "$tables/reg_table_`var'.tex", ///
    label nomtitles nonumbers width(\textwidth) nonote noobs nolines nogaps ///
    fragment b(2) ci(3) star(* 0.10 ** 0.05 *** 0.01) ///
    scalars(SE Obs Bandwidth) sfmt(%9.0fc) coeflabels(RD_Estimate "RD Estimate") replace

  • #2
    esttab is from SSC, authored by Ben Jann (see FAQ 12 and make sure you identify community contributed commands in the future).

    Right now I am using "sfmt(%9.0fc)" which gives 0 decimals for all my added scalars.
    You complain when you get what you asked for. Following the order in the -scalars()- option, you can specify multiple display formats in the -sfmt()- option

    Code:
    scalars(SE Obs Bandwidth) sfmt(%9.0fc %9.2fc %9.3fc)

    Comment


    • #3
      Thank you Andrew, that works great!

      Comment

      Working...
      X