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

st: RE: collapse missing values into zeroes when using (sum)


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: collapse missing values into zeroes when using (sum)
Date   Wed, 28 Jul 2004 00:51:10 +0100

You say that you don't want missings to be 
included in the -collapse-, as they are 
regarded as summing to 0. 

What do you want Stata to do instead? 

Nick 
[email protected] 

Monica L. Parra Torrado

> I have information at cities and state level but want to 
> aggregate it at the
> state level using weighted averages (in a very manual way).  
> For one of the
> steps I am using the command "collapse (sum) variables, by 
> (state year)" but
> then I am getting zeroes where there were missing values 
> because of the sum
> function (it does not happen with the other collapse 
> functions like sd,
> mean, etc).  I tried to use the option "cw" but since the 
> missing values are
> not for the same observation among the different variables I 
> end up having
> no observations at all. 
> So I would like to know if there is a way I could tell Stata 
> not to collapse
> missing values into zeroes when using (sum).

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index