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: recording the first/last non-missing/missing values position
From
Maarten Buis <[email protected]>
To
[email protected]
Subject
Re: st: recording the first/last non-missing/missing values position
Date
Mon, 5 Nov 2012 09:23:43 +0100
On Sun, Nov 4, 2012 at 8:19 PM, Qunzi Zhang wrote:
> The final goal is to count the nr. non-missing values
number of missing values on varname1, varname2, varname3, etc. in the
entire dataset:
count if missing(varname1, varname2, varname3, etc.)
number of missing values on varname1, varname2, etc. by some grouping
variable (id).
gen byte miss = missing(varname1, varname2, etc.)
bysort id : egen nmiss = total(nmiss)
drop miss
-- Maarten
---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany
http://www.maartenbuis.nl
---------------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/