Statalist The Stata Listserver


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

RE: st: Count presence of item on different vars


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Count presence of item on different vars
Date   Mon, 9 Oct 2006 16:47:08 +0100

As earlier suggested, you should try -reshape long-. 

Nick 
n.j.cox@durham.ac.uk 

Nikolaos A. Patsopoulos
 
> I want to create a new var (countAppear) that is going to 
> hold the count 
> of "appear at least once" of each unique value in the varlist 
> v6-v146. 
> Var v5 is the "primary" var that contains all unique values. 
> Hence, if a 
> value is not in v6 it will not be in the others as well.  Lets say we 
> have the value "text1" that appears 200 times at least once 
> in the given 
> varlist (v6-v146). So the value of  the var countAppear for 
> text1 will be 200 (int).

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