Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Finding median when using svy


From   ucb_gal <ucb_gal@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Finding median when using svy
Date   Wed, 7 Mar 2007 16:21:42 -0800 (PST)

doing it that way doesn't apply the weights, right?  i thought you had to use the prefix "svy:" to apply the survey settings.

in which case, table doesn't work with svy...

----- Original Message ----
From: Jesia Berry <Jesia.Berry@flinders.edu.au>
To: statalist@hsphsun2.harvard.edu
Sent: Wednesday, March 7, 2007 3:45:46 PM
Subject: Re: st: Finding median when using svy

As an example, to get the median age by sex, you can use the 'table'
command.

nhanes3 dataset available at
http://www-unix.oit.umass.edu/~statdata/statdata/stat-logistic.html 

use nhanes3.dta
svyset [pweight= wtpfhx6], strata(sdpstra6) psu(sdppsu6)
table hssex, c(median  hsageir count hsageir) row



Jesia Berry
Research Officer
Research Centre for Injury Studies
(and AIHW National Injury Surveillance Unit)
Flinders University
GPO Box 2100
Adelaide SA 5001
Tel: +61 8 8201 7626
Fax: +61 8 8374 0702
jesia.berry@flinders.edu.au


>>> ucb_gal <ucb_gal@yahoo.com> 8/03/2007 4:47 am >>>
I'm using household survey data and using the svyset settings.

I can't figure out how to find the median value of a variable while
using svy:

I can theoretically use:

svy: tab variable

but my dataset is way to big and the variable has way to many values to
attempt this.

Any suggestions?



 
____________________________________________________________________________________
The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/





 
____________________________________________________________________________________
The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index