Announcement

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

  • Event study (...) file ..... could not be opened r(603);

    Hi everyone! I am doing a simple event study with the command eventstudy. The results of the regression should be saved on a file (i tried to use both excel and .dta formats). I am sure about the synthax of my command and also of the correct data type. However, the regression cannot be calculated because i get the message

    file d:\temp\before_event_1.txt could not be opened
    r(603);

    It looks as a line of code that stata needs to read while executing the command, but it cannot open it. This is my own pc and nobody is using the file specified in the error line above at the same time as stata does it.

    1) I dont know how to check where the file is. I dont have any drive called "d" which stores temporary data, the working directory is simply a folder on my desktop and all temporary files are saved on another driver.
    2) how can i direct stata to run that piece of text file on another directory and how can this text file on another directory where stata can read it?

    Any help is greatly appreciated... I solved a lot of issues already with this command but I am stuck with this and honestly I don't have a clue.

    Thank you for your help...and merry christmas!

    Gabriele

  • #2
    The eventstudy command - a community contributed command hosted at SSC - has, hardcoded into the ado file eventstudy.ado, lines like the following"
    Code:
    capture mkdir `"d:\temp"'
    which tries to create a temp directory on your D: drive, and when it fails because there is no D: drive, the code does not test to see why it failed, but continues along. Then it gets to
    Code:
    outsheet using `"d:\temp\before_event_`i'.txt"'  ...
    and that fails because it cannot open (for writing into) the file in the non-existent directory on the non-existent drive.

    It's possible to edit the eventstudy.ado file and make changes, if you're so inclined.
    Code:
    . findfile eventstudy.ado
    . doedit "`r(fn)'"
    then make your changes and save it, overwriting the flawed version.

    Perhaps someone here can suggest a better alternative. Perhaps the eventstudy2 command would give you what you need.

    Comment


    • #3
      hey, eventstudy was working perfectly some months ago with a different event file, so it is not a problem of coding, thank you for trying

      Comment


      • #4
        actually i used eventstudy2 and now it works quite well, so i amo going to eventstudy2! thank you very much and merry christmas

        Comment

        Working...
        X