Dear Tastauhiko,
I apologize for the late reply. You asked in follow-up:
e.g. make analysis only among subjects who are smokers (smoke==1) at the
time of the baseline(_t0==0).
* stcox Exposure Covariate1 Covariate2 if smoke==1 ??
e.g. make analysis only among subjects who are smokers at the time of the
endpoint.
* stcox Exposure Covariate1 Covariate2 if smoke==1 ??
Since you want to analyze separately for smoking at baseline and at
the end of follow-up, it would be better if you had separate "smoke"
variables for each measurement point. So following your syntax above:
* select only those who were smokers at baseline:
. stcox Exposure Covariate1 Covariate2 if smoke_base==1
* select only those who were smokers at end of follow-up:
. stcox Exposure Covariate1 Covariate2 if smoke_end==1
* include both as variables:
. stcox Exposure Covariate1 Covariate2 smoke_base smoke_end
Michael
*
* 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/