Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Incorporating time varying variable into discrete time model
From
<[email protected]>
To
<[email protected]>
Subject
st: Incorporating time varying variable into discrete time model
Date
Wed, 16 Feb 2011 10:01:41 -0000
------------------------------
Date: Tue, 15 Feb 2011 13:44:41 -1000
From: Mike <[email protected]>
Subject: st: Incorporating time varying variable into discrete time
model
Hi all:
There are discussions about Cox model about integrating time varying
variables into a continous time model , but seem not any on discrete
time model. I would like to ask whether you know something about that.
For example, if "age at migration" is a time varying variable, since
the age increases as the duration increases. But then how to caputre
such varying effects in the model.
I have already expanded data with the following commands:
ge id=_n;
lab var id "subject identifier";
*qui list id migmonth;
expand migmonth;
bysort id: ge seqvar=_n;
lab var seqvar "spell month identifier, by subject";
bysort id: ge returnee=mig==3 & _n==_N;
lab var returnee "binary depvar for discrete hazard model";
ge logd=ln(seqvar);
ge seqvar2=seqvar^2;
ge seqvar3=seqvar^3;
lab var logd "ln(t)";
ltable migmonth rom;
ltable migmonth rom,graph title("Survivor function,migration
duration(ltable)");
ltable migmonth rom,hazard;
My current estimation commad(without the time-varying variables) is:
pgmhaz logd age marriage sex yedu hhsize num_16 wage_occup log_gdp
num_rm_v num_rm_h job_ch_mig, id(id) s(seqvar) d(returnee);
===========
You have already "expanded" the data so that there is one record in your
data set for each time-interval that the person is at risk of
experiencing the event. Any time-varying variable can be matched in to
each time interval, as appropriate. (The assumption is that the
variable is constant /within/ each interval, but can vary /between/ each
interval.) There is discussion of this in the survival analysis
materials at my webpages (URL below).
If age is collinear with elapsed time at risk (duration), then you'll
find it hard to identify their separate effects. How can one tell the
effects apart?
You are using -pgmhaz-. I suggest you update to -pgmhaz8- (-ssc install
pgmhaz8-).
Stephen
------------------
Stephen P. Jenkins <[email protected]>
Department of Social Policy and STICERD
London School of Economics and Political Science
Houghton Street
London WC2A 2AE
United Kingdom
Tel: +44(0)20 7955 6527
Survival Analysis Using Stata:
http://www.iser.essex.ac.uk/survival-analysis
Downloadable papers and software: http://ideas.repec.org/e/pje7.html
Please access the attached hyperlink for an important electronic communications disclaimer: http://lse.ac.uk/emailDisclaimer
*
* 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/