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

Re: st: collapsing efficiently

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

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

> 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
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.]

Professor Stephen P. Jenkins <>
Institute for Social and Economic Research (ISER)
University of Essex, Colchester CO4 3SQ, UK
Phone: +44 1206 873374.  Fax: +44 1206 873151.

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index