Announcement

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

  • Esttab ignores b(3) command past 1st coefficient

    Dear all,
    I'm running into an issue with my esttab command for the LaTeX tex-file.
    Here is my code:
    Code:
    est clear
    eststo: quietly ologit support_tuition T1 c.guess1a c.guess1b
    estadd local controls "No"
    eststo: quietly ologit support_tuition T1 c.guess1a c.guess1b $controls
    estadd local controls "Yes"
    eststo: quietly ologit support_tuition T1 c.guess1a c.guess1b $controlspol
    estadd local controls "Yes"
    eststo: quietly logit support_tuition_dum T1 c.guess1a c.guess1b
    estadd local controls "No"
    eststo: quietly logit support_tuition_dum T1 c.guess1a c.guess1b $controls
    estadd local controls "Yes"
    eststo: quietly logit support_tuition_dum T1 c.guess1a c.guess1b $controlspol
    estadd local controls "Yes"
    esttab, b(3) se(3) scalar(N controls) nobaselevels label  drop(cut* $controls $controlspol) unstack
    esttab using "reg1_guess.tex", replace f nomtitle  nobaselevels label drop(cut* $controls $controlspol) unstack noomitted mlab(none)  stats(N controls, label("Observations" "Controls")) eqlabels(none)  booktabs alignment(D{.}{.}{-1})
    My first esttab command gives me the results as I'd like to see them, but when the tex-file is created, it now suddenly adds more numbers behind the dot for the guess-coefficients.
    Click image for larger version

Name:	Screenshot 2023-01-31 at 12.38.49.png
Views:	1
Size:	46.7 KB
ID:	1699624


    This is how I would like it to look (the Stata output),
    but then my second command creates this:
    Click image for larger version

Name:	Screenshot 2023-01-31 at 12.39.38.png
Views:	1
Size:	57.8 KB
ID:	1699625


    I'm very confused. Does anyone know what I might be doing wrong?
    I have been using the exact same command before without this issue.

  • #2
    Your second esttab command lacks the b(3) and se(3) options.

    Comment


    • #3
      Originally posted by Nils Enevoldsen View Post
      Your second esttab command lacks the b(3) and se(3) options.
      Thanks for spotting it - now that is fixed. However - this was something I tried before and now my N gets more more 0s (see picture). Would you happen to know how to prevent that from happening?
      Click image for larger version

Name:	Screenshot 2023-02-01 at 09.43.18.png
Views:	1
Size:	48.6 KB
ID:	1699770
      Last edited by Nanna Lauritz; 01 Feb 2023, 01:45.

      Comment


      • #4
        That was why I didn't include b(3) and se(3) in the second esttab command.

        Comment


        • #5
          stats() takes a fmt() suboption, like the label() suboption. I suggest trying fmt(a3) or fmt(0).

          http://repec.org/bocode/e/estout/hlp....html#statsfmt

          Comment


          • #6
            Originally posted by Nils Enevoldsen View Post
            stats() takes a fmt() suboption, like the label() suboption. I suggest trying fmt(a3) or fmt(0).

            http://repec.org/bocode/e/estout/hlp....html#statsfmt
            Yes that works. Thank you!

            For anyone in the future struggling with this - only the second esttab command is changed, and it's changed into this:
            Code:
            esttab using "name.tex", replace b(3) se(3) f nomtitle  nobaselevels label drop(cut* $controls $controlspol) unstack noomitted mlab(none)  stats(N controls, fmt(0) label("Observations" "Controls")) eqlabels(none)  booktabs alignment(D{.}{.}{-1})

            Comment

            Working...
            X