Announcement

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

  • outreg2 add columns with addstat

    After a logit regression, I am doing a bunch of estimations, and outputting it all with outreg2
    Code:
    outreg2 using "$rootloc\regression_noeffect_output.doc", addstat("Pseudo R^2", r, "Correctly classified per confusion matrix", classified, "Area under ROC curve", aroc, "GOF: Number of covariate patterns", gofm, "GOF: Pearson chi^2", gofchi2, "GOF: Prob > chi^2", gofp) bdec(3) replace
    This works perfectly as intended.

    However, when I try adding a column after another logit and same bunch of estimations
    Code:
    outreg2 using "$rootloc\regression_noeffect_output.doc", addstat("Pseudo R^2", r, "Correctly classified per confusion matrix", classified, "Area under ROC curve", aroc, "GOF: Number of covariate patterns", gofm, "GOF: Pearson chi^2", gofchi2, "GOF: Prob > chi^2", gofp) bdec(3) append
    I get
    Code:
    invalid syntax
    r(198);
    Note that all I have changed in the command is from replace to append

    Initially I thought maybe outreg2 doesn't like that I am specifying the stat/row headers again. So I tried removing those,
    Code:
    outreg2 using "$rootloc\regression_noeffect_output.doc", addstat(r, classified, aroc, gofm, gofchi2, gofp) bdec(3) append
    but didn't help.

    What am I missing?










    Thank you for your help!

    Stata SE/17.0, Windows 10 Enterprise

  • #2
    Two ideas you could try (not sure either will work):

    1) Post the logit regressions that you ran in both cases and the resulting Stata output. I'm wondering if some of those stats weren't available in the 2nd regression (or there was some other problem with the regression).

    2) If you only ran part of the do file the 2nd time around (so that the "regression_noeffect_output.doc" file hadn't been created prior to running the "append" command in the 2nd regression).

    Also, per Statalist protocol, I will mention that outreg2 is community-contributed (SSC).

    Comment

    Working...
    X