Announcement

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

  • error (603)

    Hello! I've a mac version OSX 10.10.3
    After a xterg regression I want to use outreg2 and have the output in a .docx document.
    Unfortunately the system tells me "file myreg.txt could not be opened" r(603);
    What shall I do? i looked in the FAQ and so on, but i couldn't find a solution.
    Thank you so much


  • #2
    According to FAQ #12 you are asked to write exactly what you typed and to mention where outreg2 comes from, as it is a user-written command. You are asked to provide the version of Stata you are using as well. It could be that your file is used by another program (Word for example?) which prevents access to the file.

    Comment


    • #3
      in addition to Christophe's good advice, please tell us what "myreg.txt" is supposed to be (an output file? if so, from what?) posting your code will help with this also

      Comment


      • #4
        In addition to the above good advice, consider using the pwd command to be sure that your current working directory is what you think it is - it needs to be a directory in which you can write. On OS X, this would likely be a directory underneath /Users/yourname where yourname is the short version of your account name.

        Comment


        • #5
          ok, thanks so much, I have to create a word file in which i have to put on these following three regressions:
          • xtreg intangiblefixed l.intangiblefixedassets prpoliticysugenerici#misuraimprese scontimarginietagliprezzi#misuraimprese tettidispesa#misuraimprese compartecipazione#misuraimprese utilizzodellacostoefficacia#misuraimprese fondifarmaciinnovativi#misuraimprese politichediprezzoerimborso#misuraimprese international_s#misuraimprese i.paese i.anno, vce(robust)
          • outreg2 using myreg.docx, replace ctitle(Politiche-Comportamenti) label nose
          • xtreg roe l.roe prpoliticysugenerici#misuraimprese scontimarginietagliprezzi#misuraimprese tettidispesa#misuraimprese compartecipazione#misuraimprese utilizzodellacostoefficacia#misuraimprese fondifarmaciinnovativi#misuraimprese politichediprezzoerimborso#misuraimprese international_s#misuraimprese i.paese i.anno, vce(robust)
          • outreg2 using myreg.docx, append ctitle(Politiche-Risultati) label nose
          • xtreg intangiblefixed l.roe prpoliticysugenerici#misuraimprese scontimarginietagliprezzi#misuraimprese tettidispesa#misuraimprese compartecipazione#misuraimprese utilizzodellacostoefficacia#misuraimprese fondifarmaciinnovativi#misuraimprese politichediprezzoerimborso#misuraimprese international_s#misuraimprese i.paese i.anno, vce(robust)
          • outreg2 using myreg.docx, append ctitle(Risultati-Comportamenti) label nose
          but unfortunately it says that i have error 603, my stata version:
          Stata/SE 13.0 for Mac (64-bit Intel)
          Revision 17 Jun 2013
          Copyright 1985-2013 StataCorp LP

          my microsoft word version: version 2011 for mac, version 14.5.1 (150515)

          the file of stata is saved on my mac.
          do I need to provide additional information?
          Thank you all so much

          Comment


          • #6
            type

            which outreg2

            to get the version of outreg2. Check whether you have the latest version of the program. If not make the update.
            It is quite essential that we know, where you get the error? Is it after the first, the second or the third outreg2 command?

            Try also a simplified version of your code as shown below. Do you still get the same error? On "my" machine this code works if I change .txt to .rtf or .docx, but I cannot open the file with the .docx extension. So try with .rtf (as specified in outreg2's help file )

            Code:
            sysuse auto , clear
            reg price mpg 
            outreg2 using autoreg.txt , replace
            reg price mpg  weight
            outreg2 using autoreg.txt , append

            Comment


            • #7
              Thank you Christope,
              The version of outrage is the last i suppose, because i typed

              "ssc install outreg2" and it says that: "checking outreg2 consistency and verifying not already installed... all files already exist and are up to date." Hence, i guess it is the last version. More over i tried to use the code that you gave me, but both .rtf and .txt don't work, and neither .xls and .doc. I have found a document that says that for mac i should put this code instead of "autoreg.txt or myreg.doc" it is: "dir : seeout", but using it stata doesn't recognise "replace" and "append". Finally the error appears immediately after the first outrage2 command Hope you can help me more, Thank you so much



              Comment


              • #8
                Christophe's code works without failing for me running Stata for Macintosh release 13.1.

                Again, have you tried the diagnostic I recommended in post #4 above? When my Stata working directory is set to a directory in which I do not have write permission, I receive the same error that you report.

                Comment


                • #9
                  Hello William,
                  I wanted try your advice, but i did not understand it, I am a junior user. How shall i do it?
                  Thanks a lot

                  Comment


                  • #10
                    I have typed cd and it said:
                    . cd
                    /Users/albertopistis

                    Is it correct or should it be different?

                    Comment


                    • #11
                      The answer to your question in #9 is "type pwd into the command window" - the same one in which you eventually typed cd .

                      The answer to your question in #10 is that the cd command did not tell us where your working directory was when outreg2 failed, but it did change your working directory to your home directory. When you start Stata again, use the "Change Working Directory" item on Stata's File menu to pick the directory (folder) where you want your files written to. Then, try the 5 lines of code from Christophe's post #5 again, exactly as given, and see if the problem has gone away now that you are in your home directory.

                      Comment


                      • #12
                        Thank you so much William, it is working perfectly now! Many thanks to both of you

                        Comment


                        • #13
                          Mac OS 10.10.5
                          STATA/MP 12.1 for Mac (64-bit intel)

                          Great suggestion William! I started having the same issue today after installing Yosimite on my Mac. Suddenly, outreg2 commands that worked last night give me the "cannot open file" error. This also occured when I ran

                          svyset[pweight=perwt], vce(brr) brrweight(REPET1-REPWT80) fay(.5)mse
                          svy: reg lnincwage age agesq exp expsq uhrs i.AGGEDU i.AGGIND ib19100.MET2013 if trimw==0
                          estimates save OLSw, replace

                          on some 2013 American Community Survey data from IPUMS.

                          When checking my directory, it seems it got set to "/" after installing Yosimite. After setting up the working directory as


                          cd "Users/Craig"

                          both outreg2 and estimates save started working again. So if anyone recently installed the latest OS operating system, this may work for you.

                          Comment


                          • #14
                            Hello, I would like to ask for assistance on same outreg2 issue. I am using Mac OS 10.10 and Stata 13.1. I have set the working directory. I am getting the following in the display pane:

                            . reg mpg price rep78 weight
                            . outreg2 using table1, word replace
                            table1.rtf
                            dir : seeout

                            . shellout using `"table1.rtf"'
                            shellout probably will not work with MacOSX

                            /bin/bash: table1.rtf: command not found


                            In the working directory I found table1.txt and table1.doc and I can open both of them. But likewise in Windows, why the file table1.rtf does not open in Mac is not clear to me.

                            Would you please suggest me what to do.

                            Thanks in advance.

                            Comment


                            • #15
                              There is no great mystery here. Roy Wada, the author of outreg2 (SSC)and its associated programs, works on Windows.

                              In this case his help file on shellout is quite explicit

                              shellout is a shell wrapper designed for Windows XP/NT.
                              This isn't a "holier than him" comment, because I work on Windows too and not Macintosh (a story of my University's choices, and nothing else).

                              So, I would back up and explain what you want to do without reference to outreg2 and you are likely to get good advice. (For example, I have no idea whether .rtf is supported on Macs, but others here should know.)

                              Comment

                              Working...
                              X