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

Re: st: collapsing efficiently


From   Jenkins S P <[email protected]>
To   "'statalist'" <[email protected]>
Subject   Re: st: collapsing efficiently
Date   Thu, 18 Dec 2003 08:55:49 +0000 (GMT)

On Thu, 18 Dec 2003, Steven Stillman (LMPG) wrote:

<snip>
> This does exactly what I need but is tediously slow.  My use of egen means I
> am storing lots of unnecessary information (ie duplicate records) that I
> have no need for.
> I am pretty sure that this same idea can be used by looping over groups,
> calculating the sum, and storing this in only one observation per group.  I
> haven't been able to figure out exactly how to do this myself and am hoping
> someone else will quickly see the light here.  One problem is that summarize
> cannot be used to calculate the sum because it doesn't take non-integer
> pweights.

-help summarize- says that "aweights, fweights, and iweights are allowed;
see help weights.  However, iweights may not be  used with the detail
option."
If you have non-integer weights, then can't you use aweights or
iweights to calculate a weighted sum?  [Your weights may be interpreted
as pweights when you need to derive variances for complex survey data,
but that is not the issue here.]


Stephen
=============================================
Professor Stephen P. Jenkins <[email protected]>
Institute for Social and Economic Research (ISER)
University of Essex, Colchester CO4 3SQ, UK
Phone: +44 1206 873374.  Fax: +44 1206 873151.
http://www.iser.essex.ac.uk

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