Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: Coding Question


From   john metcalfe <johnzmetcalfe@gmail.com>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   st: Coding Question
Date   Sun, 14 Aug 2011 15:00:08 +0200

Dear Statalist,
I have a matrix of serial measurements with some missing values as
below. I would like to write a simple code that counted each
individual as a ‘conversion’ (going from 0 to 1), a reversion (going
from 1 to 0), or both. Any ideas appreciated.
Best,
John



138. | 11020189         0         1         0         1         . |
163. | 11030107         0         1         1         1         . |
181. | 11030206         1         1         1         .         . |
182. | 11030207         0         0         0         .         . |
189. | 11030265         1         1         0         0         0 |
     |------------------------------------------------------------|
192. | 11040003         0         1         1         1         . |
202. | 11040079         1         0         1         0         . |
217. | 11040225         1         0         0         .         . |
226. | 11050079         0         1         1         1         . |
243. | 11050203         1         0         1         1         . |
     |------------------------------------------------------------|
282. | 11060278         1         0         1         0         . |
310. | 11070069         1         0         0         .         . |
325. | 11070195         1         0         0         0         . |
327. | 11070229         0         1         0         1         . |
329. | 11070245         1         0         0         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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index