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 on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: anycount .a and .b


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: anycount .a and .b
Date   Tue, 3 Jul 2012 18:17:43 +0100

gen a_missing = var1 == .a
gen b_missing = var1 == .b

qui forval j = 2/600 {
      replace a_missing = a_missing + (var`j' == .a)
      replace b_missing = b_missing + (var`j' == .b)
}


On Tue, Jul 3, 2012 at 6:08 PM, Jörg Eulenberger <j.eulenberger@web.de> wrote:

> I have a dataset with ".a" ".b" and "." missings. Now i want  count the
> missing row wise (observation wise) like
>
> egen a_missing = anycount(var1-var600), values(.a)
> egen b_missing = anycount(var1-var600), values(.b)
>
> The Problem is that ".a" ".b" don't  be elements of integer numlist.
>  rowmiss count all missings and make not differences between .a .b and .
>

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