Announcement

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

  • Multiple-records survival treatment effects - Causal Joint modelling in STATA: is it possible?

    Dear all,

    Thank you in advance for your help.

    I have a long-format dataset in which I compare two treatments. I have a survival outcome (the variable event, representing drug use) and a time variable (followup). Each subject is observed multiple times, and at each time point, I also have efficacy and adverse events (adverse) outcomes measured as binary outcomes. Sex, age, and comirb are some of the covariates.

    I wonder whether STATA has tools to estimate the treatment effect (ATE and/or ATT, or at least marginal estimates of the hazard ratio). I usually use stteffects ipwra, but in this case, it does not support multiple records per subject. Are there any alternatives?

    A second question: since I have both efficacy and adverse events as binary variables, I would like to estimate a joint model for these two variables together with the event variable. I typically use the user-written stjm command for joint modeling. However, in this case, I would also like to estimate ATE/ATT.

    Do you have any suggestions? I couldn't find an answer to this question in other STATA-related posts.

    Thank you very much!

    Below is the structure of my dataset:


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(treatment id followup event efficacy) byte adverse int age byte(sex comorbid)
    0  1         6 1 0 0 39 0 1
    0  1        12 1 0 0 39 0 1
    0  1 12.866667 1 0 0 39 0 1
    0  1        36 1 0 0 39 0 1
    1  4         6 1 0 0 31 1 3
    1  4        12 1 1 0 31 1 3
    1  4      14.2 1 1 0 31 1 3
    1  4        36 1 1 0 31 1 3
    1  8         6 1 0 1 30 1 3
    1  8        12 1 0 1 30 1 3
    1  8 33.466667 1 0 1 30 1 3
    1  8        36 1 0 1 30 1 3
    1 19         6 1 1 0 22 0 1
    1 19        12 1 1 0 22 0 1
    1 19        24 1 1 0 22 0 1
    1 19 33.466667 1 1 0 22 0 1
    1 20         6 1 1 0 18 1 1
    1 20        12 1 1 0 18 1 1
    1 20        24 1 1 0 18 1 1
    1 20        36 1 1 0 18 1 1
    1 21         6 1 1 0 20 1 1
    1 21        12 1 1 0 20 1 1
    1 21        24 1 1 0 20 1 1
    1 21 33.266666 1 1 0 20 1 1
    1 22         6 1 1 0 29 0 1
    1 22        12 1 1 1 29 0 1
    1 22        24 1 1 1 29 0 1
    1 22 33.466667 1 1 1 29 0 1
    1 23         6 1 1 0 59 1 1
    1 23        12 1 1 0 59 1 1
    1 23        24 1 1 0 59 1 1
    1 23        36 1 1 0 59 1 1
    1 24         6 1 1 0 19 0 2
    1 24        12 1 1 0 19 0 2
    1 24        24 1 1 0 19 0 2
    1 24 33.466667 1 1 0 19 0 2
    1 25         6 1 0 0 43 1 1
    1 25        12 1 0 0 43 1 1
    1 25        13 0 0 0 43 1 1
    1 26         6 1 0 1 40 0 1
    1 26        12 1 0 1 40 0 1
    1 26        13 0 0 1 40 0 1
    1 27         6 1 0 0 28 1 2
    1 27        12 1 1 0 28 1 2
    1 27        24 1 1 1 28 1 2
    1 27        36 1 1 1 28 1 2
    1 28         6 1 1 0 29 1 2
    1 28        12 1 1 0 29 1 2
    1 28        24 1 1 0 29 1 2
    1 28 33.466667 1 1 0 29 1 2
    0 29         6 1 1 0 27 0 1
    0 29        12 1 1 0 27 0 1
    0 29        24 1 1 0 27 0 1
    0 29 33.466667 1 1 0 27 0 1
    0 30         6 1 0 0 40 1 2
    0 30        12 1 0 0 40 1 2
    0 30        19 0 0 0 40 1 2
    0 31         6 1 0 0 33 1 3
    0 31        12 1 0 0 33 1 3
    0 31        16 0 0 0 33 1 3
    0 32         6 1 1 0 55 1 1
    0 32        12 1 1 0 55 1 1
    0 32        24 1 1 0 55 1 1
    0 32        36 1 1 0 55 1 1
    0 33         6 1 1 0 38 0 1
    0 33        12 1 1 0 38 0 1
    0 33        24 1 1 0 38 0 1
    0 33        36 1 1 0 38 0 1
    0 34         6 1 0 0 52 0 2
    0 34        12 1 0 0 52 0 2
    0 34        19 0 0 0 52 0 2
    0 35         6 1 1 0 37 1 2
    0 35        12 1 1 0 37 1 2
    0 35        24 1 1 0 37 1 2
    0 35 33.466667 1 1 0 37 1 2
    0 36         6 1 0 0 33 0 2
    0 36        12 1 0 0 33 0 2
    0 36        19 0 0 0 33 0 2
    0 37         6 1 0 0 51 1 2
    0 37        12 1 0 0 51 1 2
    0 37        19 0 0 0 51 1 2
    0 38         6 1 1 0 48 1 1
    0 38        12 1 1 0 48 1 1
    0 38        24 1 1 0 48 1 1
    0 38        36 1 1 0 48 1 1
    0 39         6 1 0 0 24 0 2
    0 39        12 1 0 0 24 0 2
    0 39        16 0 0 0 24 0 2
    0 40         6 1 1 0 25 1 2
    0 40        12 1 1 0 25 1 2
    0 40        24 1 1 0 25 1 2
    0 40        36 1 1 0 25 1 2
    0 41         6 1 0 0 44 0 2
    0 41        12 1 1 0 44 0 2
    0 41        24 1 1 0 44 0 2
    0 41        36 1 1 0 44 0 2
    0 42         6 1 0 0 20 0 2
    0 42       9.1 1 0 0 20 0 2
    0 42        12 1 1 0 20 0 2
    0 42        36 1 1 0 20 0 2
    end
    label values treatment varl2
    label def varl2 0 "DrugA", modify
    label def varl2 1 "DrugB", modify
    ------------------ copy up to and including the previous line ------------------
    Last edited by Gianfranco Di Gennaro; 07 Feb 2025, 13:16.
Working...
X