Announcement

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

  • Esttab - numerical format of F-stat not changing

    I am formating a regression table using the codes below. The number of observations in the table has no decimals, while my F-statistic is showing up with 9 decimals instead of zero decimals as specified in the "sfmt(%9.0fc)" option of the esttab command. How can I get my F-statistic to display in the table without decimals?

    Code:
          ** Col00: OLS
            reg `var' X`n', robust
                  est store D00
                
                
            ** Col02: First stage 
            reg X`n' IV`n' , robust
                est store D02
                
                test IV`n'= 0
                estadd local fstat "`r(F)'"
                
            
            ** Col2: 2SLS
            ivregress 2sls `var'  (X`n' = IV`n'),  robust
                est store D2
            
            
            *Print table 
            esttab D00 D02 D2 using "$tablesov\regression-results.tex" , ///
            replace noobs b(%10.3f) se star(* 0.10 ** 0.05 *** 0.01)  ///
            scalars("N Number of Obsevations" "fstat F-statistic") sfmt(%9.0fc)   ///
            align(cccc) mtitles ("OLS" "First stage" "2SLS") label nogaps numbers nonotes keep(X`n' IV`n')
    Thanks

  • #2
    estout is from SSC, as you are asked to explain. The contents of locals are not necessarily interpreted as reals. In your case, the double quotes specify that the statistic is to be saved as a string. You instead want:

    Code:
    estadd scalar fstat `r(F)'
    Last edited by Andrew Musau; 26 Apr 2022, 07:15.

    Comment


    • #3
      That worked great! Thank you, Andrew.

      Comment

      Working...
      X