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: Multiple record per individual data: Counting frequency in which an individual changes from one variable value to another
From
"Weichle, Thomas" <[email protected]>
To
<[email protected]>
Subject
st: Multiple record per individual data: Counting frequency in which an individual changes from one variable value to another
Date
Fri, 5 Aug 2011 16:04:00 -0500
Hi Statalisters,
I have data which contains multiple records per individual. I have a
categorical variable X (values 1,2,3) which can vary from record to
record within the individual. I'd like to know if there is a command
that will count the number of times in which an individual changes to a
different value in variable X. Consider the following example:
study_id X
100 2
100 2
100 2
100 3
555 1
555 1
555 2
555 2
555 1
555 1
study_id 100 would count as 1 change.
study_id 555 would count as 2 changes.
Tom Weichle
Math Statistician
Center for Management of Complex Chronic Care (CMC3)
Hines VA Hospital, Bldg 1, C202
708-202-8387 ext. 24261
[email protected]
*
* 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/