So, I get the above stata error when using outreg2 which I install with “ssc install outreg2″.
This articles tells you (1) what I did to trigger the error message and (2) what steps I took to fix it.
UPDATE JUL2009: A good comment below suggests (from stata staff) that it has to do with disk writes. So, that’s the best answer to date.
It comes up at odd times. I’m running a loop with 600 sets of 3 regressions and am outregging to each separately. That is:
forvalues i=1/600 {
regress XXX
outreg2 using file1
regress XXX
outreg2 using file2
regress XXX
outreg2 using file3
}
And so it’s appending to the existing file each time.
I also had two variants. That is, I used:
quietly: outreg2 using file2, brackets
the quietly surpresses output and the brackets replaces the parentheses (that excel thinks are negative numbers) with brackets.
I then went and looked for the outreg2_prf.ado file. I checked in C:\ado\plus\o where the other outreg2 files are. I couldn’t find this file. So I downloaded it and saved it to the directory. I got the file from http://ideas.repec.org/c/boc/bocode/s456416.html
***NOT FIXED
Well, I fixed the missing .ado error, but my code still breaks at a random place and says that one of my outreg2 output files is missing. Since it doesn’t break the same place each time, I’m a bit confused as to what’s going on. Still troubleshooting by trying to run it from a different directory and then on a different computer.
***
ACK! Giving me the error again! I am trying ssc uninstall outreg2 and then ssc install outreg2.
Also trying restarts of Stata. I’m running Stata 10 SE by the way.
***
Ok. Not sure what I did, but it appears that I fixed it. I did three things:
1) I changed my regression directory. I had previously had the working directory under some really long (more than 100 characters) pathname, so I put it into c:\data.
2) I put my do file in the same directory
3) I closed STATA, opened, and ran ssc uninstall outreg2 and then ssc install outreg2 as the first thing in my new session.
Oddly, neither 1 alone nor (1+2) fixed the problem.
Bottom line: I don’t think the bug is directly in outreg2. I think it is related to long pathnames.
Oddly enough, the code *did* work with this path:
C:\Documents and Settings\Howard\My Documents\UCEI\Bushnell EU Carbon\stage2\Project Management10 – panel of stock prices vs market model plus price of carbon
but not with this path:
C:\Documents and Settings\Howard\My Documents\UCEI\Bushnell EU Carbon\stage2\Project Management18 – add oil price\regress
Hope nobody has to deal with this (including myself) and that my troubleshooting steps are helpful to someone someday (including myself)
UPDATE I no longer get this error code. It was very sporadic. I’m now running a smaller data set, and I think that makes a big difference.
Comment by howardchong — April 7, 2009 @ 9:09 pm
Hi Howard,
I was having the same issues you were having but didn’t have as much luck solving the problem. I wrote to STATA support and this is their solution:
Dear Alex,
It the hard drive is too slow to keep up with the data that Stata is
generating. That is why this is happening at different times for different
runs. The hard drive is only keeping up with Stata to a certain point.
To correct this you can place a -sleep- command in your loop to to make sure
your files are finished writing before Stata tries to move on. Windows will
only allow Stata to access one file at a time. See -help sleep- for more
information on the -sleep- command.
Hope it helps you or anyone else who might have this problem again.
Alex
Comment by Alex — July 24, 2009 @ 6:08 pm