Announcement

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

  • Help with a piecewise cox regression as an approach for proportional hazards violation

    Dear Statalist,

    Hello!

    I am studying time to discontinuation of contraception between covert (or secret) users vs. open users using survival analysis. I have stset the data from “t0” (time of method initiation, 0 for everyone) until time to discontinuation or censoring; this outcome variable is “disc_exact” and is coded as 0 (continued/censored at interview) vs 1 (failed or discontinued). The duration variable to time of event is measured in months as “new_duration”. I also have a variable, “p1”, for delayed entry as many women come into my study already using contraception for a given number of months; this variable is coded as the time in months of use since method initiation and entering the study.

    Here is how I st set my data:

    stset new_duration [pweight=P2_P2FUweight_new], failure(disc_exact) origin(t0) enter(p1) exit(new_duration=60)

    Here is the structure of my data:

    . list P1_user_type t0 disc_exact new_duration p1 in 1/15

    +-----------------------------------------------+
    | P1_user_type t0 disc_e~t new_du~n p1 |
    |-----------------------------------------------|
    1. | 0. Overt use 0 0 19 7 |
    2. | 1. Covert use 0 1 12 7 |
    3. | 0. Overt use 0 0 95 84 |
    4. | 0. Overt use 0 0 58 46 |
    5. | 0. Overt use 0 0 43 31 |
    |-----------------------------------------------|
    6. | 0. Overt use 0 0 18 6 |
    7. | 0. Overt use 0 0 24 11 |
    8. | 0. Overt use 0 0 65 53 |
    9. | 1. Covert use 0 1 28 27 |
    10. | 0. Overt use 0 0 65 53 |
    |-----------------------------------------------|
    11. | 0. Overt use 0 0 12 1 |
    12. | 0. Overt use 0 0 88 76 |
    13. | 0. Overt use 0 0 19 7 |
    14. | 0. Overt use 0 1 35 34 |
    15. | 1. Covert use 0 1 59 56 |
    +-----------------------------------------------+


    .




    When I look at the Kaplan Meir curves for the two groups, I see a crossing of the survival function (or to be exact, the failure/discontinuation function in this case) at ~20 months. I’d like to run a cox regression to analyze predictors of discontinuation of contraception by my independent variable of interest (covert/overt use) with some other covariates, and I believe this shows a proportional hazards violation. My understanding is that one approach to this is to create a piece wise regression wherein I model 0-20 months and 20-60 months but I am having trouble doing so. Do I need to use the time varying covariate? Set up multiple observations per woman?



    Many many thanks in advance, I really appreciate your time.

    Attached Files
Working...
X