Quantcast

st: Outreg2 - file cannot be openend

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

st: Outreg2 - file cannot be openend

Christian Weiss-2
Dear Statalisters,

What I intend to do is to run multiple regressions and eventually save
all the results via outreg2 in an excel file.

To do so, the do File contains the following outreg2 code (regression
and estimates store code ommited)
regresssion 1
outreg2 [*] using myfile , replace sideway bdec(3) groupvar(Group1
ebit5yr beta beta_sqr logmarketcap propertyrights regulation
tcr5hat_sqr Group2 debtofassets   capexofassets diversification
Group3)

regression2
outreg2 [*] using myfile, append sideway bdec(3) groupvar(Group1
ebit5yr beta beta_sqr logmarketcap propertyrights regulation
tcr5hat_sqr Group2 debtofassets
>  capexofassets diversification  Group3)
file d:\asd.txt could not be opened

regression3
. outreg2 [*] using myfile, replace sideway bdec(3) groupvar(Group1
ebit5yr beta beta_sqr logmarketcap propertyrights regulation
tcr5hat_sqr Group2 debtofassets
capexofassets diversification  Group3) excel

The first regression uses outreg "replace" option to start a new/clean
outreg2 reporting table, the last one the "excel" option to generate
the .csv file

However, I frequently receive the error "file myfile.txt could not be
openend" r(603).
It appears that the error occurs kind of random and I am not able to
reproduce it all the time. I already tryied changing the working
directory, using the full path specification for the file, deleting
all the files from the working directory. I did not change any
permissions to directory folders, standard working directory is the
windows user folder.

I also tried the outreg2 without the "append" option and wihtout the
"excel" option, same problem.

Do you have any suggestions how to yield the intended results?

Thx a lot
Chris

Viele Grüße
Christian

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: st: Outreg2 - file cannot be openend

Roy Wada
> regression2
> outreg2 [*] using myfile, append sideway bdec(3) groupvar(Group1
> ebit5yr beta beta_sqr logmarketcap propertyrights regulation
> tcr5hat_sqr Group2 debtofassets
>> capexofassets diversification Group3)
> file d:\asd.txt could not be opened
>

Your Stata is looking for a file called "d:\asd.txt", but there is no
"asd.txt" anywhere in your outreg2 command.

Are you sure this is the relevant portion of your do-file?
 
Roy
 
_________________________________________________________________
With Windows Live, you can organize, edit, and share your photos.
http://www.windowslive.com/Desktop/PhotoGallery
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: st: Outreg2 - file cannot be openend

Christian Weiss-2
Dear Roy,

you are absolutely right, however, the problem remains.
I just was experimenting if the problem might be caused by the
filename and copied the wrong error message.

The error message which tends to appear using the previously given
outreg2 command is "file myfile.txt could not be opened"

Sorry for the confusion

Chris



On Sun, Sep 6, 2009 at 1:43 PM, Roy Wada<[hidden email]> wrote:

>> regression2
>> outreg2 [*] using myfile, append sideway bdec(3) groupvar(Group1
>> ebit5yr beta beta_sqr logmarketcap propertyrights regulation
>> tcr5hat_sqr Group2 debtofassets
>>> capexofassets diversification Group3)
>> file d:\asd.txt could not be opened
>>
>
> Your Stata is looking for a file called "d:\asd.txt", but there is no
> "asd.txt" anywhere in your outreg2 command.
>
> Are you sure this is the relevant portion of your do-file?
>
> Roy
>
> _________________________________________________________________
> With Windows Live, you can organize, edit, and share your photos.
> http://www.windowslive.com/Desktop/PhotoGallery
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: st: Outreg2 - file cannot be openend

Roy Wada
> The error message which tends to appear using the previously given
> outreg2 command is "file myfile.txt could not be opened"
>
> Chris

Apparently the file does not exist or cannot be read. This is different
from the read-only problem. I once heard from a person whose computer had
a sporadic problem locating files. The problem went away after she started
using another computer, so that was it. It could be network related if you
are using Stata over a local network.
 
 
It's probably something else but I can take a look if you can send me a log
file and a trace output.
 
Roy

 
*** creates a log file
set logtype text
log using mylog.txt, replace
about
update
sysdir
adopath
pwd
cd
which outreg2
[insert your stuff here]
log close
 
 
*** creates a trace output
set logtype text
set trace on
log using mytrace.txt, replace
about
update
sysdir
adopath
pwd
cd
which outreg2
[insert your stuff here]
log close
 
 
_________________________________________________________________
Windows Live: Make it easier for your friends to see what you’re up to on Facebook.
http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON:WL:en-US:SI_SB_facebook:082009
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: st: Outreg2 - file cannot be openend

Roy Wada
>> The error message which tends to appear using the previously given
>> outreg2 command is "file myfile.txt could not be opened"
>>
>> Chris
>
> Apparently the file does not exist or cannot be read. This is different
> from the read-only problem. I once heard from a person whose computer had
> a sporadic problem locating files. The problem went away after she started
> using another computer, so that was it. It could be network related if you
> are using Stata over a local network.

Chris test a few things for me and it seems this problem may come up on
laptops with slowed-down harddrives or bus speed. They don't tell you this
but it would make sense for a laptop manufacturer to install a normal-spreed
(7200 rpm) drives and then quietly throttle (restrict) its performance in order
to make the battery last longer, and still retain the bragging rights for faster
drvies and long-battery life.
 
This reminds of Apple Computer (as in Apple IIe) that supposedly sent
a finished message to the user while still in the middle of program execution
and thereby giving the false impression of impressive performance. I doubt
Stata is doing this, since it would undoubtly cause havoc somewhere.
 
This issue of file permission has come up before.
 
http://www.stata.com/statalist/archive/2009-06/msg00827.html
http://www.stata.com/statalist/archive/2009-05/msg00394.html
 
A solution is to deliberately slow down the execution of outreg2 so that it
does not look for or try to access a file before it is ready. The future
versions of outreg2 should come with a -slow- option or something like it that
will take care of it for people with slower read/write drives. People who need
it now can get it from me.
 
This problem was difficult to diagnose because it cannot be captured by a
trace output. -trace- will automatically slow down the program execution and
thereby make the problem go away, albeit temporarily.
 
Recently there have been user-requrests for the displaying of the program line
number along with any error messages. Normally I don't need it but it would
been useful in this case since there was no easy way to diagonse the breakage,
which I tracked by asking Chris to run a version with display markers inserted.
 
Incidenlty SSD (solid-state drives) are supposed to be several times faster
than the platter-designs. It probably won't affect Stata's market share too
much but it does make harddrive-based solutions more attractive, as in running
significantly faster than they do today.
 
Roy
 
_________________________________________________________________
With Windows Live, you can organize, edit, and share your photos.
http://www.windowslive.com/Desktop/PhotoGallery
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: st: Outreg2 - file cannot be openend

ajdbarros
I'm having the same problem described here, but with use and merge commands. My original impression of a slow drive activity was confirmed by the posts. So I started disabling all applications that might be slowing down drive access. First, accessing files outside my dropbox area helped a lot, but not solve the problem. Next thing was disabling the real time protection from McAffee... No further file access errors!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: st: Outreg2 - file cannot be openend

ajdbarros
Completing the previous post - I'm running a fast machine (i7 processor, 8GB memory) and was having this awkward issue of file access errors. Having identified the problem with McAffee antivirus suite, I uninstalled it and installed AVG 9 free. Tested the program, and no further problems.

It seems that there are free lunches sometimes, after all.

Hope this can help troubled programmers at some point.

Best,

Aluisio
Loading...