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: prtest and survey weights


From   Steve Samuels <[email protected]>
To   [email protected]
Subject   Re: st: prtest and survey weights
Date   Sat, 13 Mar 2010 09:35:01 -0500

It's not clear which two proportions Omar wants to compare .  If he
means correlated proportions (two attributes measured on the same
person), here's a way that uses -svy: tab-

**************************CODE BEGINS**************************
sysuse auto, clear
svyset _n
set seed 2000
gen u=uniform()
sort u
gen cat = _n<39   // new 2-level category
svy: tab foreign cat
test _b[p12] = _b[p21]
lincom _b[p12] - _b[p21]
***************************CODE ENDS***************************

If he means: test the equality of two cell proportions of the same
attribute,  he can use -svy: prop- as Mary stated.

***************************CODE BEGINS**************************
sysuse auto, clear
svyset _n
svy: prop rep78
test _b[1] = _b[5]
lincom _b[1] - _b[5]

svy: prop foreign
test _b[Foreign] = _b[Domestic]    //Use the category values shown in
the results
test _b[1] = _b[0]                // Unlabeled values don't work
***************************CODE ENDS***************************

Steve



On Fri, Mar 12, 2010 at 2:20 PM, Mary E. Mackesy-Amiti <[email protected]> wrote:
> I believe you can use svy: proportion followed by test (post-estimation
> command).
>
> see: help proportion postestimation
>
>
> Omar McDoom wrote:
>>
>> Dear all,
>>
>> Does anyone know how I may compare two proportions drawn from a variable
>> in
>> a weighted survey?  The svy command I understand is not available for
>> prtest.  Is there a work-around that allows one to incorporate survey
>> design
>> effects/weights?
>>
>>
>>
>>
>
> --
> Mary Ellen Mackesy-Amiti, Ph.D.
> Research Assistant Professor
> Community Outreach Intervention Projects (COIP)
> School of Public Health m/c 923
> Division of Epidemiology and Biostatistics
> University of Illinois at Chicago
> ph. 312-355-4892
> fax: 312-996-1450
>
> *
> *   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/
>



-- 
Steven Samuels
[email protected]
18 Cantine's Island
Saugerties NY 12477
USA
845-246-0774

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