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

RE: st: Statsby and weights

From   "Nick Cox" <>
To   <>
Subject   RE: st: Statsby and weights
Date   Thu, 25 Mar 2004 19:28:47 -0000

In the case of frequency weights, a prior
=expand- is presumably another possibility. 
Of course, this changes your dataset, but 
since -statsby- is going to change it too, that 
itself is secondary. More importantly, the 
dataset might become very large; and even 
more importantly, this technique doesn't 
help with non-frequency weights. I guess
Jeff may be able to think of other disadvantages. 


> -----Original Message-----
> From:
> []On Behalf Of 
> Jeff Pitblado,
> StataCorp LP
> Sent: 25 March 2004 19:08
> To:
> Subject: Re: st: Statsby and weights
> Dale Plummer <> asks about using 
> weights with
> -statsby-:
> > I may have overlooked something obvious, but I cannot see why the
> > statsby command will not allow weights in the commands it 
> is executing.
> > Would someone please explain this?
> There really isn't a good reason for this.  From a 
> development point of view,
> -statsby- uses the same parsing engine as -bootstrap-, 
> -jknife-, -simulate-,
> and -permute-; some of which require careful consideration 
> (and new code) to
> handle weights.
> There are ways around this.  The long way is to set up 
> -postfile- and use
> -post- within a -forvalues- loop.  This requires a decent 
> amount of coding to
> reproduce some of the features of -statsby-.
> The short way, involves tricking -statsby-.  I generally 
> would warn users
> against trying to "trick" a command to do something that a 
> developer purposely
> tried to prevent, but this is one of those special cases.

*   For searches and help try:

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