Statalist


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

Re: st: restrict subjects for analysis from multi-record data


From   Michael McCulloch <mm@pinest.org>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   Re: st: restrict subjects for analysis from multi-record data
Date   Wed, 8 Oct 2008 09:20:05 -0700

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/



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