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   Guy Grossman <[email protected]>
To   [email protected]
Subject   Re: st: AW: creating variable from svy: proportion
Date   Mon, 3 May 2010 10:47:12 -0400

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.

Guy



On Mon, May 3, 2010 at 10:28 AM, Martin Weiss <[email protected]> wrote:
>
> <>
>
> You may want to explain what you are failing to achieve with an official
> example:
>
>
>
> *************
> use http://www.stata-press.com/data/r11/highschool, clear
> svy: prop race, over(sex)
> mat l e(b)
> *************
>
> -svmat- can turn matrices into variables, btw.
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> [mailto:[email protected]] Im Auftrag von Guy Grossman
> Gesendet: Montag, 3. Mai 2010 16:21
> An: [email protected]
> Betreff: st: creating variable from svy: proportion
>
> Dear Stata listers,
>
> forgive me for posting such a basic question. I am using Stata 10.1 to
> analyze an original stratified three-stage cluster sample survey in
> which observation are farmers (individuals) sampled from groups
> (pocode) themselves sampled from larger farmer cooperatives (dccode).
> isb17 is a dummy variable measured at the individual level. I am
> trying to create a variable at the PSUs level (dccode), which is the
> proportion of farmers in the cooperative that have  isb17==1.  I am
> reluctant to use the collapse command given the survey design.
>
> svyset dccode [pw= pweight], strata (strata) fpc(fpc1) || pocode,
> fpc(npos) || _n, fpc(popop)
> svy: proportion isb17, over(dccode)
>
> What I am failing to do, is to take the e(b) from ereturn and generate
> a variable that represents isb17==1 at the dccode level.
> Help would be highly appreciated.
>
> Cheers,
> Guy
>
> *
> *   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/
>
>
> *
> *   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/
>

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