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]

st: Non integer weights - problem


From   "Raquel Guimaraes" <raquelrguimadem@gmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Non integer weights - problem
Date   Sun, 5 Feb 2012 14:12:10 -0800

Dear all,

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

Any ideas?

Thank you,

Raquel

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