Announcement

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

  • Problem appending new columns with outreg2

    Hello all,

    I am having trouble appending the results of successive regressions to my output file on Stata12. This is baffling because:
    a. I've used the do file with outreg2 commands on Stata10 before and it worked.
    b. If I save the results to a new file the outreg2 command works, but I have a separate file for each regression result.

    I'm attaching the code with the hope that someone can help me out:

    outreg2 using /Users/nabeela/data/var/TABLE1_sep28, title (Table 1: Effect of X on Y - 1995-2005, Dependent variable - Y) ctitle (2SLS) drop(dyr*) bdec(3) sdec(3) alpha (0.01, 0.05, 0.10) addstat (LM (underid), e(idstat), p-val of LM, e(idp), Wald (weak instruments), e(rkf), Hansen J, e(j)) addnote("", year dummies not shown, Exogenous instrument - grt) label word append

    The error message I get is:
    in range not allowed
    r(101);

    I'd very much appreciate some pointers on this. Thanks!

    Nabeela Alam

  • #2
    Try using a much pared down version of your command (i.e. omit options), and then start adding them back in so that you can see which one is causing a problem. If this doesn't help, then set trace on before running the command, and see which line is causing the problem. With all this information, you'd be in a better position to report back to the Forum ... to which: welcome! However, please take steps to maximize your chances of getting feedback -- respect Forum FAQ etiquette and (a) re-register using your real name (firstname lastname) via the Contact Us button at bottom right; and (b) post code and output using CODE delimiters, accessible via the advanced editor (A button, followed by # -- see the FAQ). Thank you.

    Comment


    • #3
      I had the same error message (Stata version 14.0 for Mac)

      What seemed to cause the problem was the empty line in the note option:
      Code:
      addnote(" ", "some note text")
      Using the option without an empty line it works:
      Code:
      addnote("some note text")
      Interestingly, it is possible to add several lines of notes like this:
      Code:
      addnote("some note text", "a second line of note tex", "a third line of note text")
      So the only thing that does not seem to work is the empty line.
      I wonder wether this is a bug, since the helpfile suggests using " " to add an empty line.

      Comment


      • #4
        I followed Isabel Martinez's advice and deleted the empty string in the lines of code that generated the original file, and no longer got the error message.
        I had tried deleting the outreg2 options one by one before, but this had not helped.
        Note that the empty string was in the bit of code that generated the file(s):
        Code:
        outreg2  using "myfile", nor2 nocons
        excel tex  replace
        title("title")
        ctitle("ctitle") cttop("cttop")
        addn("", "Time $S_TIME, $S_DATE", "Data from $S_FN");
        However, the error message was generated following the line of code that appended the new column
        Code:
        outreg2 
        using "myfile", eform nocons
        alpha(0.001, 0.01, 0.05) symbol(***, **, *)
        excel tex  append
        ctitle("ctitle")
        addstat(F, e(F_mi), Average RVI, e(rvi_avg_mi))
        addtext(FE, yes);
        it would be helpful to know whether this is a bug/new coding rule in Stata14, as I had previously run the do file in Stata12 and no error message had been returned.

        Comment

        Working...
        X