I am doing a large registry-based study in which I am doing Cox-regression for mortality rates in hyperthyroid individuals compared to euthyroid individuals. Furthermore, I subdivide the hyperthyroid group into treated and untreated individuals. The cases are defined by a blood-sample; a decreased TSH-measurement (below 0.3).
I want to look at the length of exposure, and the effect of longer exposure (low tsh) on mortality. As the hypothesis is that if you have low TSH levels for a long time your system strain is higher and it will cause you to die sooner than if your exposure to low TSH is closer to 0 months.
In order to look at the length of exposure I have a time-dependent cumulative covariate, to capture the number of six-month periods during which the participant is exposed
Thus, 2 variables are created: a dummy variable for low TSH pr half year (0 or 1, depending on normal or low TSH), and a cumulative variable (the number of half years up until this point counted as exposed (low TSH)). The followup period is 32 half-years.
The table shows an example dataset:
Iām not sure how to implement this into a cox-regression, so I tried to find a solution by doing the following:
rsdato is the date of TSH-measurement, pnr is the id.
I ran my Cox-regression:
"gruppe" is the variable describing if you are euthyroid (normal TSH: =1), treated hyperthyroid (TSH<0.3: =2) or untreated hyperthyroid (=3) ā at baseline, charlson is the comorbidity score.
Contrary what I expected to find, the HR is below 1 for cumulative (the longer you are exposed the longer you have lived and the less you have died). I suspect this is because of the statistical problem also seen in eg. cancer-research when controlling for pack-years; the people who have smoked the longest have a lower mortality rate. This being because they have survived long enough to increase their pack-years.
So the question ā how can I measure the effect of each exposed half-year on survival? In other words: calculating the changes in mortality rates pr half year exposed (lived with low tsh).
I want to look at the length of exposure, and the effect of longer exposure (low tsh) on mortality. As the hypothesis is that if you have low TSH levels for a long time your system strain is higher and it will cause you to die sooner than if your exposure to low TSH is closer to 0 months.
In order to look at the length of exposure I have a time-dependent cumulative covariate, to capture the number of six-month periods during which the participant is exposed
Thus, 2 variables are created: a dummy variable for low TSH pr half year (0 or 1, depending on normal or low TSH), and a cumulative variable (the number of half years up until this point counted as exposed (low TSH)). The followup period is 32 half-years.
The table shows an example dataset:
id | low_tsh_1 | low_tsh_2 | low_tsh_3 | cumulative_tsh_1 | cumulative_tsh_2 | cumulative_tsh_3 |
134 | 1 | 1 | 1 | 1 | 2 | 3 |
135 | 0 | 1 | 0 | 0 | 1 | 1 |
136 | 1 | 0 | 1 | 1 | 1 | 2 |
137 | 0 | 1 | 1 | 0 | 1 | 2 |
Iām not sure how to implement this into a cox-regression, so I tried to find a solution by doing the following:
Code:
generate halfyear=floor((rsdato-12785)/(365.25/2)) bysort pnr halfyear: egen avg_tsh=mean(TSH_n) sort pnr halfyear quietly by pnr halfyear: gen dup_tsh=cond(_N==1,0,_n) drop if dup_tsh>1 gen dummy_TSH_low=1 if avg_tsh<0.3 replace dummy_TSH_low=0 if avg_tsh>=0.3 bysort pnr (halfyear): gen cumulative=sum(dummy_TSH_low) collapse (max) cumulative, by(pnr)
rsdato is the date of TSH-measurement, pnr is the id.
I ran my Cox-regression:
Code:
stcox i.gruppe c.age i.charlson i.sex cumulative
"gruppe" is the variable describing if you are euthyroid (normal TSH: =1), treated hyperthyroid (TSH<0.3: =2) or untreated hyperthyroid (=3) ā at baseline, charlson is the comorbidity score.
Contrary what I expected to find, the HR is below 1 for cumulative (the longer you are exposed the longer you have lived and the less you have died). I suspect this is because of the statistical problem also seen in eg. cancer-research when controlling for pack-years; the people who have smoked the longest have a lower mortality rate. This being because they have survived long enough to increase their pack-years.
So the question ā how can I measure the effect of each exposed half-year on survival? In other words: calculating the changes in mortality rates pr half year exposed (lived with low tsh).
Comment