Announcement

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

  • Can't open miest.ster

    Dear Statalist,

    I am trying do run a Cox regression on an imputed dataset using restricted cubic splines. I used the following code (the data are correctly stset, and stcox using the imputed datasets works fine):

    Code:
    mi set mlong                                                                                                                                     
    mi register imputed HADSA_gli PartAg_gli Sex                                                                                                                  
    mi impute chained (pmm, knn(10)) HADSA_gli PartAg_gli Sex , add(10)  
    
    mi estimate, post  sav(miest, replace) : stcox i.HADS_A_gli PartAggli_spline1 PartAggli_spline2 i.Sex if glicopd_HUNT==1 | glicopd_HUNT==2 & HADS_A_gli!=. & PartAg_gli>=40.0 & PartAg_gli<=85.0
    When I run the last command, I get the error message
    r(603); file miest.ster could not be opened
    , meaning that miest.ster exists, but can't be opened.

    What do I do wrong?


  • #2
    I wonder whether the working directory was specified previously.
    Best regards,

    Marcos

    Comment


    • #3
      Hi,

      I tried the following:

      Code:
      pwd
      
      C:\Program Files (x86)\Stata15\docs
      
      
      cd C:\Program Files (x86)\Stata15\docs
      But still got the same error message r(603) when re-running mi estimate.

      Comment


      • #4
        The next logical question might be: do you have write privileges to that directory? If it's a university computer, then you may not have write privileges. You could change the working directory to My Documents, where you probably have write privileges.
        Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

        When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

        Comment


        • #5
          That worked, thank you

          Comment


          • #6
            You are welcome. I am glad that this issue was easily resolved!
            Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

            When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

            Comment

            Working...
            X