Bookmark and Share

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: RE: Forming risksets in matched case control studies


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: Forming risksets in matched case control studies
Date   Wed, 16 Feb 2011 19:46:02 +0000

The first observation of two clear visits is tagged by 

bysort id (visits) : gen isclear_visit = (visit == 0) & (visit[_n+1] == 0) 

Persons who include such pairs of visits in their history are tagged by 

bysort id : egen isclear_id = max(isclear_visit) 

Nick 
[email protected] 

Nasheed Moqueet

My exposure and outcome of interest are both binary. The plan is to do
a conditional logistic regression analysis after matching case and
controls on time and ethnicity. My data is stacked and longitudinal
and I am having trouble figuring out how to code for cases.

A case is someone who is clear for atleast 2 successive visits, so two
0s in visits that are next to each other. However, the problem is as
below. Please help. Thanks.

For example, ID 5 and 7 are both cases, even though ID 7's visits are
not strictly successive.
ID visits status
5   3       1
5   4       0
5   5       0
7   2       0
7   4       0

ID 8 is NOT a case, however, because the 0s are not in successive visits

ID visits status
8  1        1
8  2        0
8  5        1
8  6        0
8  7        1
8  8        0

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index