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

# Re: st: Weighted proportion

 From Steve Samuels To statalist@hsphsun2.harvard.edu Subject Re: st: Weighted proportion Date Thu, 4 Oct 2012 20:04:42 -0400

```I can't find this command, Yuval.  What's the source? And how does it solve Daniel's problem of weighting the data?

Steve

On Oct 4, 2012, at 7:26 PM, Yuval Arbel wrote:

You can also try::

-twoway__histogram_gen varname, generate (h x) frequency-

in which case you will get in the editor two variables (h and x) -
where one of which is the numerical values of the variable and the
other is the frequency

BTW: Somebody asked a similar question a few days ago, and Nick Cox

On Fri, Oct 5, 2012 at 1:17 AM, Yuval Arbel <yuval.arbel@gmail.com> wrote:
> What about -tabulate-? this will give you exactly what you are asking for
>
> On Fri, Oct 5, 2012 at 1:10 AM, Daniel Almar de Sneijder
> <dasneijder@gmail.com> wrote:
>> Uhm yes, but that will give me the mean instead of the proportion...?
>>
>> On Thu, Oct 4, 2012 at 6:28 PM, kantor.d@att.net <kantor.d@att.net> wrote:
>>> Have you tried
>>> summarize rrace [weight=RWEIGHT]
>>> ?
>>>
>>> Sent with Verizon Mobile Email
>>>
>>>
>>> ---Original Message---
>>> From: statalist@hsphsun2.harvard.edu
>>> Sent: 10/4/2012 5:13 pm
>>> To: statalist@hsphsun2.harvard.edu
>>> Subject: st: Weighted proportion
>>>
>>> Dear statalist,
>>>
>>> Any thoughts on a handy function or command to summarize the weighted
>>> proportion? For instance, I have a variable that indicates to which
>>> Race a respondent belongs. For example
>>>
>>> RRACE = 1 if Hispanic
>>> RRACE = 2 if White
>>> RRACE = 3 if Black
>>> RRACE = 4 if Other
>>>
>>> Additionally I have a variable that weights the respondents (due to
>>> oversampling of Hispanic's in my database), call this variable
>>> RWEIGHT.
>>>
>>> Now I want to summarize the weighted proportions of RRACE, i.e. how
>>> much % is Hispanic, White, etc.
>>>
>>> Obviously I can plot a histogram by the command [see below] which will
>>> give me an overview of the proportions.
>>>
>>> histogram rrace [weight = RWEIGHT], discrete width(1) percent
>>>
>>> My question is: how can I get these proportions into the result window?
>>>
>>> Thank you!
>>> Daniel
>>> *
>>> *   For searches and help try:
>>> *   http://www.stata.com/help.cgi?search
>>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>>> *   http://www.ats.ucla.edu/stat/stata/
>>>
>>> *
>>> *   For searches and help try:
>>> *   http://www.stata.com/help.cgi?search
>>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>>> *   http://www.ats.ucla.edu/stat/stata/
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> *   http://www.ats.ucla.edu/stat/stata/
>
>
>
> --
> Dr. Yuval Arbel
> 4 Shaar Palmer Street,
> Haifa 33031, Israel
> e-mail1: yuval.arbel@carmel.ac.il
> e-mail2: yuval.arbel@gmail.com

--
Dr. Yuval Arbel
4 Shaar Palmer Street,
Haifa 33031, Israel
e-mail1: yuval.arbel@carmel.ac.il
e-mail2: yuval.arbel@gmail.com
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

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