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: AW: creating variable from svy: proportion


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: AW: creating variable from svy: proportion
Date   Mon, 3 May 2010 11:19:41 -0400

Guy Grossman:
Try also:

webuse nhanes2, clear
svy:tab region heartatk, row ci
ssc inst _gwtmean
egen m=wtmean(heartatk), by(region) weight(finalwgt)
ta region, sum(m)


On Mon, May 3, 2010 at 11:01 AM, Maarten buis <[email protected]> wrote:
> --- On Mon, 3/5/10, Guy Grossman wrote:
>> sorry for not being sufficiently clear. using the official example at
>> I wish to create a variable which is equivalent to the
>> proportion of female by race at the county level. meaning all the
>> observations within the same county will receive the same value of this
>> proportion.
>
> The easiest way is probably to use -regress- on your dummy variable,
> followed by -predict-. A proportion is nothing other than the mean
> of an indicator variable, so that is why you can use -regress-, and
> -regress- allows the -svy- prefix.
>
*
*   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