Announcement

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

  • bys: outreg2 is returning error message: invalid 'onebyone' r(198)

    Hi everyone,
    I just installed stata13 in a new computer (I used to use Stata in my old computer and everything was good). So now I'm having "weird" messages such as unrecognized outreg2 (so I installed it, but I was thinking that stata13 already contain outreg2!). Anyway, the new error message I'm having is that it didn't recognize the bys option of outreg2. So, I checked the manual and it's there, I mean that outreg2 has a bys option. So, can enyone make me understand why stata is returning these errors and how to correct for the last one.
    Thanks.

  • #2
    bys option can be used only in a specific combination of commands, what did you type and what was the result?
    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    FinTechProfessor.com
    https://asdocx.com
    Check out my asdoc program, which sends outputs to MS Word.
    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

    Comment


    • #3
      Part of this is easy: outreg2 is user-written (SSC) so doesn't come bundled with official Stata. You need to install it when setting up a new computer.

      As for the rest: outreg2 supports the bysort: prefix command (which is not an option, but as said a prefix command). So you are telling us that you got an error but not showing us your exact code. I think you need to show exact code, so that users of outreg2 (not me) have a chance to advise.

      Alternatively, contact the program author directly: he is not active on Statalist.

      Comment


      • #4
        Thanks Attaullah,
        I typed the following
        Code:
        bys Group: outreg2 using mydoc, append title ("Table : Summary statistics by groups of companies") sum(log)
        Knowing that Group is a variable that takes two values 0 and 1 to distinguish between two groups of observations.
        The stata message is the following:
        invalid 'onebyone'
        r(198);

        And I checked for the outreg2, normally the bys prefix is allowed!
        Thanks again.

        Comment


        • #5
          Does

          Code:
           
          onebyone
          correspond to anything in your dataset?

          Comment


          • #6
            Thanks Nick.
            No, it does not!

            Comment


            • #7

              Code:
              bys Group: outreg2 using mydoc.doc, append title ("Table : Summary statistics by groups of companies")  side replace : reg y x1 x2 x3
              Try the above code, replacing y and x with your variables.

              For summary statistics, you can use
              Code:
              bys Group: outreg2 using mydoc.doc, append title ("Table : Summary statistics by groups of companies") side replace : sum y x1 x2 x3
              Last edited by Attaullah Shah; 10 Dec 2014, 11:48.
              Regards
              --------------------------------------------------
              Attaullah Shah, PhD.
              Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
              FinTechProfessor.com
              https://asdocx.com
              Check out my asdoc program, which sends outputs to MS Word.
              For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

              Comment


              • #8
                As said, I don't use outreg2 but it's easy enough to search the code and to find that onebyone is an option used by a program defined within
                outreg2
                .

                So an internal call within the program is triggering a syntax error. Who knows otherwise why that could be. I think you need to contact the program author, Roy Wada, and send him a reproducible example of your error.

                Comment


                • #9
                  Originally posted by Attaullah Shah View Post
                  Code:
                  bys Group: outreg2 using mydoc.doc, append title ("Table : Summary statistics by groups of companies") side replace : reg y x1 x2 x3
                  Try the above code, replacing y and x with your variables.

                  For summary statistics, you can use
                  Code:
                  bys Group: outreg2 using mydoc.doc, append title ("Table : Summary statistics by groups of companies") side replace : sum y x1 x2 x3
                  I tried your solution and I got the not sorted error message even though the data is sorted by the id variables!!!

                  Comment


                  • #10
                    You have to sort the data by variable that is used in the outreg2 command. This error message implies that the original problem has been solved.
                    Regards
                    --------------------------------------------------
                    Attaullah Shah, PhD.
                    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
                    FinTechProfessor.com
                    https://asdocx.com
                    Check out my asdoc program, which sends outputs to MS Word.
                    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

                    Comment


                    • #11
                      And if the problem stays, try this alternative
                      Code:
                      tabstat y x1 x2 x3, statistics( mean count max sd min ) by(group) columns(variables)
                      Copy as table and paste in Excel.
                      Regards
                      --------------------------------------------------
                      Attaullah Shah, PhD.
                      Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
                      FinTechProfessor.com
                      https://asdocx.com
                      Check out my asdoc program, which sends outputs to MS Word.
                      For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

                      Comment


                      • #12
                        Although this is an old thread, it still seems relevant to the current version of outreg2 running in Stata 16. When replicating Example 16 (Group summary table) from the help guide, using the help file code, I receive the error message given above (invalid 'onebyone'). After uninstalling and then reinstalling both outreg and outreg2, the error persisted.

                        However there is a solution of sorts. When removing options one by one, I found that using the drop() option was causing the error (in this case). While drop() wasn't used in the original post above, if this problem reoccurs, I recommend trying this command with the smallest number of options that you can manage with.
                        Last edited by Vaughan Connolly; 06 Feb 2020, 09:40.

                        Comment

                        Working...
                        X