Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: time varying variable in Cox regression


From   "raoul reulen" <[email protected]>
To   [email protected]
Subject   st: time varying variable in Cox regression
Date   Tue, 27 Mar 2007 22:15:40 +0100

Hi,

I'm investigating the influence of the number of offspring on cancer
risk. I consider the number of offspring (0, 1, 2 or more than 3) as a
time-varying variable and use Cox regression. I first stsplit after
each date of birth, and generate a variable that contains the
offspring number.

.stset dox, fail(fail) origin(dob) entry(doe) scale(365.25) id(Indexno)
.stsplit child1 , after(dob_child1) at(0)
.stsplit child2 , after(dob_child2) at(0)
.stsplit child3, after(dob_child3) at(0)
.bysort Indexno: gen child_number= _n-1    ///generates variable with
no of offspring
.xi: stcox i.child_number

However, several dates of birth are missing and obviously STATA will
not split the data on these missing dates. For example for some
individuals, the dob for the first child is known, but missing for the
second, and again known for the third. How should I handle such
missing values?

Raoul
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index