Announcement

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

  • Problem with outreg2 command after updating computer

    Hello,

    I updated my computer today and now when I run the outreg2 command to export tables to excel, stata produces the following error:

    Code:
    outreg2 using enrollmentinstrument.xls, stats(coef tstat)
    file enrollmentinstrument.txt could not be opened
    r(603);

    I know this is a user written package, but perhaps someone can assist.

    I'm running stata SE 14.2.

  • #2
    This is the error:
    error . . . . . . . . . . . . . . . . . . . . . . . . Return code 603
    file __________ could not be opened;
    The file, although found, could not be opened. Check to see if
    it is currently open in another application or, if it is a file
    on your network, it is being used by another person. If it is
    not in use, check to see if the file is in a directory where
    you are allowed to create files.

    Comment


    • #3
      I suspect "If it is not in use, check to see if the file is in a directory where you are allowed to create files" indicates the problem. I've occasionally had problems where the directory I was trying to write to was a directory I couldn't write to. So I changed directories. If you've updated, then default directories or read/write permissions may have changed.
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      Stata Version: 17.0 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #4
        I note that your command has using enrollmentinstrument.xls but the error message (and help outreg2) suggests that a text file is required. Perhaps this mismatch is causing the error?

        If not, perhaps your working directory is no longer where it was before whatever you did that "updated your computer". Have you issued the pwd command from Stata's Command window to ensure that your working directory is in a place that should be writable by you?

        Comment


        • #5
          Originally posted by William Lisowski View Post
          I note that your command has using enrollmentinstrument.xls but the error message (and help outreg2) suggests that a text file is required. Perhaps this mismatch is causing the error?

          If not, perhaps your working directory is no longer where it was before whatever you did that "updated your computer". Have you issued the pwd command from Stata's Command window to ensure that your working directory is in a place that should be writable by you?
          I also upgraded to stata se yesterday and had to reinstall stata 14. it may be in a new directory. but I have always used the .xls suffix to write to an excel file and it has always worked before.

          Comment


          • #6
            Originally posted by Richard Williams View Post
            I suspect "If it is not in use, check to see if the file is in a directory where you are allowed to create files" indicates the problem. I've occasionally had problems where the directory I was trying to write to was a directory I couldn't write to. So I changed directories. If you've updated, then default directories or read/write permissions may have changed.
            What would be a possible solution for this? I don't know very much about directories.

            Comment


            • #7
              I fixed it with the following code:

              Code:
              mkdir C:\Results
              cd C:\Results
              I'm not satisfied with this though as I don't want to have to work in an isolated directory. I want it to run like it used to out of my normal directory.

              Comment


              • #8
                Without knowing what your normal directory is, there's not much we can comment on.

                Comment


                • #9
                  Just do something like

                  cd c:\statadata

                  or some other directory that you have (create one if necessary).

                  As William says, if you type

                  pwd

                  it will show you what your current working directory is. If I'm right, I bet it is the program files directory or the Windows directory. Windows whines if you write to such places and don't give administrator permission first.

                  If you're a Maccie, I don't know how exactly directories work, but I'm sure it can be done.

                  EDIT: Crossed with the last few messages
                  -------------------------------------------
                  Richard Williams, Notre Dame Dept of Sociology
                  Stata Version: 17.0 MP (2 processor)

                  EMAIL: [email protected]
                  WWW: https://www3.nd.edu/~rwilliam

                  Comment


                  • #10
                    I'm not satisfied with this though as I don't want to have to work in an isolated directory. I want it to run like it used to out of my normal directory
                    OK. just say

                    cd:\MyNormalDirectory

                    using whatever that directory is.
                    -------------------------------------------
                    Richard Williams, Notre Dame Dept of Sociology
                    Stata Version: 17.0 MP (2 processor)

                    EMAIL: [email protected]
                    WWW: https://www3.nd.edu/~rwilliam

                    Comment


                    • #11
                      Incidentally you should have set a default directory when you installed Stata. You may have changed it when you re-installed.
                      -------------------------------------------
                      Richard Williams, Notre Dame Dept of Sociology
                      Stata Version: 17.0 MP (2 processor)

                      EMAIL: [email protected]
                      WWW: https://www3.nd.edu/~rwilliam

                      Comment


                      • #12
                        Thanks everyone for your advice

                        Comment


                        • #13
                          I also have an issue with generating outreg results, the error . outreg using c:Advemergingecon. doc
                          invalid 'doc'
                          r(198);
                          could any one please help?

                          best

                          Comment


                          • #14
                            I see a space there before doc

                            If the space is really in your file extension you need " " around it.

                            I wouldn't put results files in the root of C: personally, but that's a different point.

                            Comment

                            Working...
                            X