Announcement

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

  • Using stsplit for time-varying covariates in stcox

    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 am splitting the hyperthyroid individuals into treated and untreated individuals, as to ascertain the effect of treatment on mortality. I have the euthyroid controls in one group (gruppe=1), the treated hyperthyroid individuals as gruppe=2, and the treated hyperthyroid individuals as gruppe=3. being in the treated group is defined as having redeemed a prescription for antithyroid medication at any point during the follow-up period.

    My stset looks like this
    Click image for larger version

Name:	image_4654.png
Views:	1
Size:	5.7 KB
ID:	1335440


    My cox regression takes into consideration the age, sex and charlson comorbidity score:
    Click image for larger version

Name:	Skærmbillede 2016-04-13 kl. 11.40.12.png
Views:	1
Size:	4.0 KB
ID:	1335442



    Similar calculations have been done in another study.

    Recently one of my supervisors pointed out that we might want to take in to consideration the time between the start of followup and the start of treatment, as the time being untreated can have an effect on mortality. We thus decided to have the treated hyperthyroid individuals function as untreated hyperthyroid individuals until the day treatment started. We have considered doing this by utilizing stsplit:
    Click image for larger version

Name:	Skærmbillede 2016-04-13 kl. 11.53.22.png
Views:	1
Size:	4.8 KB
ID:	1335443


    "eksd" being the date of treatment start (redeemed prescription). People who have not received treatment thus have eksd=. and have not been split.

    I changed the group variable "gruppe" to 0 for the euthyroid individuals (controls), and 1 for the hyperthyroid individuals.

    I now want to stcox the set, and compare the treated hyperthyroid individuals to the euthyroid individuals, the treated hyperthyroid individuals compared to the euthyroid individuals, and the treated compared to the untreated.

    I am unsure how to go about this, specifically which variables to include, how to separate the treated and untreated hyperthyroid individuals, and if this even is a statistically valid approach. If not, suggestions for other approaches are much appreciated.
    Last edited by Mads Lillevang-Johansen; 13 Apr 2016, 04:34.

  • #2
    I will follow this.

    Comment


    • #3
      Thanks for the clear description of your question and your approach. A couple of typos (e.g., "treated hyperthyroid individuals as gruppe=2, and the treated hyperthyroid individuals as gruppe=3") make it slightly difficult to follow so I will assume the original coding is

      1 euthyroid
      2 untreated hyperthyroid
      3 treated hyperthyroid

      It seems your question concerns the approach for classifying/coding the exposure of interest rather than the technicalities of using stplit and fitting models following stsplit. Either way, I am going to answer that question. If you're not sure about the technicalities of modelling split data then you should be able to find plenty of good references. I would encourage you to examine your data (looking at the internal variables _d _st_t0 and _t), tabulate events and person time (e.g., using strate) in both the split and unsplit data and fit a simple model to both the split and unsplit data (to check you get the same estimates).

      I think you (and your supervisor) are absolutely correct to be concerned. A fundamental rule of survival analysis is "don't condition on the future". By creating a "treated" group you are conditioning on a future event (treatment) where the patient must be alive. If treatment were assigned randomly and had no effect on the outcome then you would observe lower mortality in the "treated" group using your original approach.

      I think the easiest way to code the data is to partition the person-time for each individual into the three groups above. That is, the person time of the individuals originally in group 3 will be split between groups 2 (time before treatment) and 3 (time after treatment). Those originally in groups 1 and 2 will only contribute person-time to one group.

      The fact that you have conditioned on diagnosis enables you to combine the person-time among the never-treated and the pre-treatment person-time among the treated. You do, however, need to think about indications for diagnosis and indications for treatment and possible implications for inference.

      You wrote "I now want to stcox the set, and compare the treated hyperthyroid individuals to the euthyroid individuals, the treated hyperthyroid individuals compared to the euthyroid individuals, and the treated compared to the untreated", which contains another copy-paste typo. With my proposed setup it is simple to compare any 2 of the 3 groups to each other.

      The comparison of "treated compared to the untreated" cannot be performed among the patients in the original group 3 since, by definition, none of them can have died before they commenced treatment.

      You could estimate the exact same contrasts using two binary variables (hyperthyroid, and treated) and fitting the interaction between them but I think it's much more transparent to code a single variable as above. The cross between two binary variables will have four categories, but one of them (treated euthyroid) will be empty so you will have to take extra care with parameterisation.

      Code:
      group   treat    hyper
      1          0        0
      2          0        1
      3          1        1

      Comment


      • #4
        Thank you very much for the answer! Sorry for the typos

        Comment

        Working...
        X