Bookmark and Share

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Incorporating time varying variable into discrete time model

From   Mike <>
Subject   st: Incorporating time varying variable into discrete time model
Date   Tue, 15 Feb 2011 13:44:41 -1000

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);

Thanks a lot!
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index