Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Counting Ulcers


From   "Dimitriy V. Masterov" <dvmaster@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Counting Ulcers
Date   Thu, 7 Sep 2006 17:33:28 -0400

Try

bys id: egen type=sum(vi) if vi~=.
collapse type, by(id)

This will count people with missing observations as "." and not zero,
and it will avoid double-counting.

DVM
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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