Announcement

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

  • Factor variables and time-series operators not allowed

    Hello,
    I am studying survival analysis for my thesis. When I type the following commands, it is showing the same error messages.
    Could you please guide me how to deal with this problem.

    Code:
    . stset time, fail( failure) exit(time.) id( iso3) enter(time0)
    factor variables and time-series operators not allowed
    r(101);

    . stset i.time, fail( i.failure) exit(i.time.) id( Iso3 ) enter( i.time0)
    factor variables and time-series operators not allowed
    r(101);


    ​I am using Stata 14 on Windows 8
    Thanks and Regards,
    Su

  • #2
    The first one should work if you remove the period after time.

    Comment


    • #3
      Dear Masterov,
      I am not clear with what you have suggested. Which one I have to remove?
      Thanks,
      Su

      Comment


      • #4
        Try
        Code:
        stset time, fail( failure) exit(time) id( iso3) enter(time0)
        instead of
        Code:
        stset time, fail( failure) exit(time.) id( iso3) enter(time0)
        There's an superfluous period after time in exit() that is causing the error.

        Comment


        • #5
          The warning from stset means you cannot use variables using either the i.var or L.var or var#var etc.

          You dont need to, however. Your time, entry and exit variables would surely be continuous variables, and there's no need for the i.var notation. In short, the first line of code (minus the '.') should do the trick, i'd say. Did you have a good reason to write 'stset i.time'?


          Comment


          • #6
            To be honest I do not have a good reason to use 'stset i.time'. Since I am not familiar with Stata, I just tried to follow the previous posts' comments. Another thing is that my data is having multiple failure-time, so I specify the entry and exit time. If I remove the exit(time.), last events are removed from the list.

            Thanks and regards,
            Su

            Comment


            • #7
              Su:
              I would recommend you to take a look at both -help stset- and the comprehensive set of entries on survival analysis reported in Stata .pdf manual.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Thanks Carlo San,

                I will have a look at them.

                Best Regards,
                Su

                Comment

                Working...
                X