Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: anycount .a and .b
From
Nick Cox <[email protected]>
To
[email protected]
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 <[email protected]> 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/