Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: parents breaking up - multiple failure survival data w. the Anderson-Gill model

 From Austin Nichols To "statalist@hsphsun2.harvard.edu" Subject Re: st: parents breaking up - multiple failure survival data w. the Anderson-Gill model Date Fri, 15 Jul 2011 15:29:56 -0400

```Tinne--
This is very interesting data! Switch to discrete time hazard models
and maybe semiparametric methods

On Friday, July 15, 2011, Tinne Steffensen <tst@sfi.dk> wrote:
> Dear Statalist.
>   I have a dataset containing 135.000 children - and information on their parents in a time period from 1980-2007. I'm only interested in them after the year of the id's birth. So for some id's I have observations for 4 years others over a 20 year time-period.
>
>   I am interested in analyzing the hazard ratios of the parents breakup(=move from shared address). However there is a possibility of the parents breaking up several times during the period, so I wanted to use the multiple failure-time survival data. t 0 is the birth of my id, t is years after the birth and livetog is if the parents live together that year or not.
>
> Stset, id year
>
> To give you an example:
> +------------------------------------------------------+
>    | id    group            t0   t   breakup  livetog  Inc  |
>    |------------------------------------------------------|
>    |  1   treatment   0      1        0             1           3 |
>    |  1   treatment   1      2        0             1           3 |
>    |  1   treatment   2      3        0             1           4 |
>    |  1   treatment   3      4        1             0          3 |
>    |------------------------------------------------------|
>    |  2   treatment   0      1        0             0           0 |
>    |  2   treatment   1      2        0             0           2 |
>    |  2   treatment   2      3        0             0           2 |
>    |------------------------------------------------------|
>    |  3   control        0      1        0             0           3 |
>    |  3   control        1      2        0             1           4 |
>    |  3   control        2      3        1             0           1 |
>    |  3   control        3      4        0             1           2 |
>    |  3   control        4      5        1             0           2 |
>    +------------------------------------------------------+
>
>    I have tried following the guideline from http://www.stata.com/support/faqs/stat/stmfail.html - ordered failure events "The Anderson-Gill model". So that there for each id is one observation per event or time interval, I've created the variables var"i" - it looks like the following;
>
> +------------------------------------------------------+
>    | id     group   t0        t     break  livetog   Inc  t0i ti  breaki|
>    |--------------------------------------------------------------------------|
>    |  1   treatment   0      1        0        1          3      0     3     1  |
>    |  1   treatment   1      2        0        1          3      3     4     0  |
>    |  1   treatment   2      3        1        1          4       .     .     .    |
>    |  1   treatment   3      4        0        0         3        .     .     .    |
>    |-------------------------------------------------------------------------|
>    |  2   treatment   0      1        0        0         0      0     3     0   |
>    |  2   treatment   1      2        0        0         2        .     .     .    |
>    |  2   treatment   2      3        0        0         2        .     .     .    |
>    |-------------------------------------------------------------------------|
>    |  3   control         0      1        0        0         3        .     .     .     |
>    |  3   control         1      2        0        1         4         .     .     .    |
>    |  3   control         2      3        1        0         1        0     3     1  |
>    |  3   control         3      4        0        1         2         .     .     .    |
>    |  3   control         4      5        1        0         2        3     5     1  |
>    +-------------------------------------------------------------------------+
>
> Along the line of the Anderson-Gill model I have done;
>
> Stset ti, fail(breaki) exit(ti .) id(id) enter(t0i)
>
> But following error comes up:    option exit invalid.
>
> 1. Isn't it right to put exit(time i.) since I want to keep the id's after their first breakup and until the observation runs out.
> 2. It seems wrong to follow the Anderson-Gill model, when creating so many missings - but in the guideline (3.2.1) there are only observations for the times of event, so that is what I tried creating. Is the missing values for the "i" variables not excluding the values for group and income in the other years from the model? I have a lot of other variables than group and income, that I want to add to the model along the way.
> 3.  Furthermore I would like to include that breaking up (moving from shared address) is only possible when living together - how do I take this into consideration in my model?
>
> I have tried reading the guideline, extracts from "An introduction to survival analysis using Stata", googling, reading old statalist posts etc., but I can't seem to find a solution. I hope you can help!
>
> Thank you for your time.
> Kind regards, Tinne S.
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```