Announcement

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

  • Cox proportional analyses with panel data

    Hello All,

    I am doing some survival analyses with data collected in panel form and I think I am not getting something right because it keeps telling me the "varlist is not allowed".

    I am starting with the basics of -sts graph- after setting the data (stset gap failure(dx)).

    Data looks like this:
    id no state gap dx
    1 1 1 0 0
    1 2 1 20 1
    2 1 0 0 0
    2 2 0 5 0
    3 1 1 0 0
    3 2 1 5 0
    3 3 1 15 1
    3 4 1 20 1
    3 5 1 26 1
    4 1 0 0 0

    Four patients have a sequence of events(follow up periods). At each visit they may either have "dx" or not. 'Dx" is the failure event and they should get censored once "dx"==1. "Gap" is the time variable. "state" is the patient group.

    I plugged in sts graph by (state) after setting the data as above. No luck.

    Does anybody know where I am going wrong?

    Thanks.

  • #2
    Two problems with your syntax: you need a comma before the -by- option, and you can't have a blank between the by and the left parenthesis.

    Code:
    sts graph, by(state)

    Comment


    • #3
      Oh my! I thought it was something more. Thank you Clyde.

      Comment


      • #4
        There is also a comma missing in your -stset- command. It should be
        Code:
        stset gap, failure(dx)
        These little things just have to be right when you are programming.

        Comment


        • #5
          Thank you Paul.

          Comment

          Working...
          X