Announcement

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

  • Cox analysis time-varying covariates - data setup and tvc vs stp

    Hi all,

    I am wondering if anyone can shed some light on how to deal with my time-varying covariates.
    As a side note: I am using STATA MP version 15.1

    Specifically, I originally had a dataset with the following form
    Firm ID Firm Failure Quarters Survived
    1 1 3
    2 0 40
    However, I now believe this is not correct since my covariates (gender, age and nationality diversity are time-varying, it is measured on a quarterly basis)

    So I have changed my dataset to the following form (example using dataex).
    BvdIdNumber: company ID
    Gender, Age, Nationality: diversity indices for the group (Blau & coefficient of variation)
    _st: 1 if observation is to be used
    _d:1 if firm failed
    _t: Analysis time, I now have it always for every quarter (0-1, 1-2...).
    _t0: Start analysis tile


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str16 BvdIdNumber float(Gender Age Nationality) byte(_st _d _t _t0)
    "AT9070350951" 0 .25851214 0 1 0  1  0
    "AT9070350951" 0 .25851214 0 1 0  2  1
    "AT9070350951" 0  .2530698 0 1 0  3  2
    "AT9070350951" 0  .2530698 0 1 0  4  3
    "AT9070350951" 0  .2530698 0 1 0  5  4
    "AT9070350951" 0  .2530698 0 1 0  6  5
    "AT9070350951" 0 .24785185 0 1 0  7  6
    "AT9070350951" 0 .24785185 0 1 0  8  7
    "AT9070350951" 0 .24785185 0 1 0  9  8
    "AT9070350951" 0 .24785185 0 1 0 10  9
    "AT9070350951" 0 .24284475 0 1 0 11 10
    "AT9070350951" 0 .24284475 0 1 0 12 11
    "AT9070350951" 0 .24284475 0 1 0 13 12
    "AT9070350951" 0 .24284475 0 1 0 14 13
    "AT9070350951" 0 .23803593 0 1 0 15 14
    "AT9070350951" 0 .23803593 0 1 0 16 15
    "AT9070350951" 0 .23803593 0 1 0 17 16
    "AT9070350951" 0 .23803593 0 1 0 18 17
    "AT9070350951" 0 .23341388 0 1 0 19 18
    "AT9070350951" 0 .23341388 0 1 0 20 19
    "AT9070350951" 0 .23341388 0 1 1 21 20
    "AT9070422953" 0         0 0 1 0  1  0
    "AT9070422953" 0         0 0 1 0  2  1
    "AT9070422953" 0  .0288615 0 1 0  3  2
    "AT9070422953" 0 .05656854 0 1 0  4  3
    "AT9070422953" 0 .05656854 0 1 0  5  4
    "AT9070422953" 0 .05656854 0 1 0  6  5
    "AT9070422953" 0         0 0 1 0  7  6
    "AT9070422953" 0         0 0 1 1  8  7
    end
    However, I am unclear how to deal with the violation of the PH assumption, as well as how to adapt the dataset.

    Here are my main questions/concerns?
    - I have an observation per quarter, but perhaps this is not ideal.
    - Are my covariates time-varying? I believe they are, however they don't constantly change over time (eg. sometimes they change, sometimes they don't)
    - I used tvc, but it might be better to use stsplit? If so at what time should I split (whenever one of the diversity variables is different to the previous period?)
    - How to move forward after PH assumption violation for specifically time-varying covariates?

    Thank you in advance for your advice!

    Best regards,
    Laura
    Last edited by Laura Hill; 04 May 2023, 03:59. Reason: cox regression
Working...
X