Hello everybody, I plan to analyze the relationship between drug exposures to my interest outcome. Due to the fact that I obtain data every 6 months, I would like to analyse my model as cox proportional hazard with drug exposure as time varying exposure. I learned from STATA manual guide and it said that you would do by stsplit or expand. However, there are many drugs in this study so let's say exposure to A B C D and I think that taking any combination of this might impact the results so I would like to create multivariable model by adjusting with all drug exposure in this study, sex and age. But I'm not certain if my methods were right. So I would like you guys to check whether it is okay.
Here is my table.(this is preliminary table so I have not put all information in my original table yet. All I would like to know is just to check if my idea is correct) Supposing that code is personal id, sex = 1 means female, 2 means male, event = 0 means censor, 1 means event occured, t = observed time( counted from the beginning to when event happened or was censored.), A means drug A exposure; A = 0 means never use, A = 1 means ever use, same definition are applied for B,C,D. In addition, supposing that the effect of exposure will remain constant after exposure.
n code sex age event t A B C D
1 101 1 45 0 6 1 0 0 0
2 101 1 45 0 8 0 1 1 0
3 102 1 51 0 6 1 0 0 0
4 102 1 51 1 13 1 0 0 0
5 103 2 52 1 4 0 1 0 1
6 104 2 57 0 3 1 0 0 0
7 105 2 43 0 5 0 0 0 1
8 106 2 38 0 2 0 0 0 0
9 107 2 45 0 6 0 1 0 0
10 107 2 45 1 11 0 0 1 0
From this table I do command " stset t, id(n), failure(event) scale(1) "
Then I use command " stcox A B C D age sex".
What I just want to know if my process is right as I would like to find the association between each drug and event?
P.S. I am very newbie to this program
Many thanks
Piere
Here is my table.(this is preliminary table so I have not put all information in my original table yet. All I would like to know is just to check if my idea is correct) Supposing that code is personal id, sex = 1 means female, 2 means male, event = 0 means censor, 1 means event occured, t = observed time( counted from the beginning to when event happened or was censored.), A means drug A exposure; A = 0 means never use, A = 1 means ever use, same definition are applied for B,C,D. In addition, supposing that the effect of exposure will remain constant after exposure.
n code sex age event t A B C D
1 101 1 45 0 6 1 0 0 0
2 101 1 45 0 8 0 1 1 0
3 102 1 51 0 6 1 0 0 0
4 102 1 51 1 13 1 0 0 0
5 103 2 52 1 4 0 1 0 1
6 104 2 57 0 3 1 0 0 0
7 105 2 43 0 5 0 0 0 1
8 106 2 38 0 2 0 0 0 0
9 107 2 45 0 6 0 1 0 0
10 107 2 45 1 11 0 0 1 0
From this table I do command " stset t, id(n), failure(event) scale(1) "
Then I use command " stcox A B C D age sex".
What I just want to know if my process is right as I would like to find the association between each drug and event?
P.S. I am very newbie to this program
Many thanks
Piere
Comment