Announcement

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

  • Running -outreg2- after stcox and problem with N-Sub

    Hi,

    I am running Cox proportional hazard models and exporting the results using -outreg2-.

    The scalars that I export are N, N_Sub, N_fail, N_clust, chi2, and ll.

    All of the scalar values that I need get exported except for N_Sub (number of subjects). Then I get this message after -outreg2-: "check eret list for the existence of e(N_Sub)"

    I checked the scalars of the model and it seems that they are generated and stored in memory. But, N-Sub is not exported. Is this a bug? Have you ever faced a similar problem?

    Thanks,
    Navid

  • #2
    Dear Navid, please show exactly what you type (by copy and paste) and exactly what Stata replay. A common mistake is case sensitive, use ​ e(N_sub) and NOT e(N_Sub).

    Comment


    • #3
      Navid:
      exploiting a bit on Oded's useful insight: was your scalar named N_Sub or N-Sub?
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        A moment's glance at http://www.stata.com/help.cgi?stcox shows that e(N_sub) is the name in question, so Oded is correct: Navid is just typing the wrong name.

        Comment


        • #5
          Sorry, that was a typo.
          That is the code that I am using:

          Code:
          #delimit ;
          outreg2 [base controls maineff equity_interact uniq_interact sic_interact] using $baseoutput , 
          excel replace stats(coef se) bdec(2) e(N N_Sub N_fail N_clust chi2 ll)label paren  title("Base Case");

          Comment


          • #6
            Yes, my mistake was in using capital S. Thanks for the help!

            Comment

            Working...
            X