Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Non integer weights - problem


From   Nick Cox <[email protected]>
To   [email protected]
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
<[email protected]> 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index