Announcement

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

  • Categorical (or discrete?) time-varying covariates in EHA using streg and stcox

    Hello everyone!

    I need some advice on using streg / stcox when using time-varying covariates. I have some very specific questions, so I made a new post, since I have found nothing of similar that could help me out in the forum. Anyway, the thing is that I want to run an EHA model on the transition to the first child as outcome variable and a set of explanatory covariates, of which many would be time-varying, such as employment status (yes or no) or social class (5 categories). I made my dataset in such a way that every row represents a month for each person starting when they're 20 years old: so a 24 years old has 5*12 rows (born in january, survey time being december). Since I couldn't understand myself a couple of things reading books, manuals and STATA help, I thought it was necessary to ask you on this forum. I will list my questions to avoid confusion, sorry for the long post...


    1) Do discrete time-varying covariates have to have a certain structure in particular? I mean, for example, can one person join and exit unemployment more times or they can just exit/join once? Can I have something like "0 0 0 1 1 1 1 0 0 0" or I am forced to have "0 0 0 0 1 1 1 1 1"? for each individual?

    2) Can discrete time-varying covariates assume more categories than two? I am not sure, but I have noted that I get very weird results when using TVC that are not dichotomous.

    3) Does it make a serious difference using stcox instead of streg? I heard I can't use streg properly with TVCs, is that true?

    4) Since I am using TVCs, do I have to specify the id option in stset? Aren't the episodes my new unit of analysis? (I actually get even weirder results when i do not specify id).

    5) In case of using streg, how do I exactly interpret time-ratios? Does a value below 1.0 represent a faster transition with respect to the reference? Does 0.5 mean that transition time is half of the reference?


    Thanks to anyone whom will want to take the time to answer me. I hope I have not broken any forum rule writing this, otherwise I apologize. Best regards.
    Last edited by Andrea Berni; 18 Nov 2017, 09:05.

  • #2
    To answer your questions:

    1. No special structure is needed for binary indicators or for any time-varying predictor

    2. More than two categories are allowed, just as they are in every other regression setting. If you show us the code and "weird results"" output, as FAQ 12 asks, we can comment. Be sure to put everything between CODE delimiters. (For an example, see William Lisowski's post number 2 in this thread.) If your variable has K categories, you'll need 0-1 indicators for K-1 of the categories. But you don't have to do this by hand: See the help for "factor variables".

    3. Yes there is a "serious difference" between stcox and streg. The manual entries should make that clear: a) stcox is semiparametric and does not assume any particular form for the baseline distribution (when all covariates are zero); streg distributions are parametric. So, for example, the baseline distribution for the exponential distribution is a function of one parameter; that for the Weibull is a function of two parameters. In addition, streg fits some log linear models (models for log time) that stcox cannot.

    4. Yes you do need the id() option in stset if covariate values change with time. I don't know what you mean by an episode or "unit of analysis", so I'll not answer that question.

    5. Time ratios multiply times. A time ratio less than 1 means that the reference survival curve is shifted to the left. So, for example, if the median time for a reference person is t_m=30 months then the median of a person with time ratio =.5 is t_m/2=15 months ; i.e. poorer survival. A time ratio greater than 1 shifts the survival curve to the right, so with the reference median of 30 months, and a TR = 2, the corresponding median is 60 months, i.e. better survival.
    Last edited by Steve Samuels; 25 Nov 2017, 10:45.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      Thanks a lot, Steve! Sorry for my late reply (I had lost hope). I figured out most of these things myself reading stuff, however your answer is much appreciated. Have a good day Sir.

      Comment

      Working...
      X