Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: counting values across variables


From   Jason Thompson <jat@northwestern.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: counting values across variables
Date   Thu, 14 Apr 2005 11:53:51 -0500

Is there a Stata equivalent of the SPSS count function, which counts the number of occurrences of a particular value amongst a set of variables? Something like this:

count (newvar)=a1 to a21 (5), which assigns newvar the number of times a1-a21 equals 5 for each case?

Nothing in egen seems to be quite what I'm looking for.


*
* 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