Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Non integer weights - problem


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Non integer weights - problem
Date   Mon, 6 Feb 2012 00:51:30 +0000

The problem reported was weights not being integers. You tried to
round them if they were negative. However, it is evident that you do
not have any negative values, whether integer or non-integer.

However, there is no need to round your weights. -collapse- permits
all kinds of weights. But you need to find out whether your weights
should be aweights, iweights or pweights. No information in this mail
tells you what you should do.

Nick

On Sun, Feb 5, 2012 at 10:12 PM, Raquel Guimaraes
<raquelrguimadem@gmail.com> wrote:

> I had a problem using collapse and expanding my sample using frequency
> weights:
>
> . collapse (count) id [fw=wtper], by (granosest sex)
> may not use noninteger frequency weights
>
> However, I summarized the weight variable and they seem to be fine:
>
> . sum wtper
>
>    Variable |       Obs        Mean    Std. Dev.       Min        Max
> -------------+--------------------------------------------------------
>       wtper |   3971891    17.56003    8.800185          2     167.13
>
> In order to solve this, I tried to create new rounded values, but none was
> created:
>
> . replace wtper_rounded=0 if  wtper<0
> (0 real changes made)
>
> Also, I tried to recast, but the error persists.
>
> . recast int wtper
> wtper:  3932021 values would be changed; not changed
>
> . collapse (count) id [fw=wtper], by (granosest sex)
> may not use noninteger frequency weights
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index