Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: SVY: tab with three variables


From   "Adebola Odunlami" <[email protected]>
To   <[email protected]>
Subject   st: SVY: tab with three variables
Date   Fri, 01 May 2009 10:01:55 -0400

Hi all,

I was hoping someone would please address my question below. Any help/insight is greatly appreciated.
thanks in advance.

I am relatively new to stata and I have a few related questions. I want to get proportion of units that answered a question( variable name = psysymps) by thier gender(sex) and race (race3cat) after I survey set the data. I tried "bysort race3cat: tab psysymps sex, row col chi2"  but then realized the percentages were off and I needed to use svy commands. I then tried "svy: tab racet3cat sex, tab (psysymps) row se ci" but got a response that the table contains 0 in the marginals and therefore statsitics cannot be computed. I realized that one of the race categories (e.g. White) was not asked the question. So I created a new race category ("blackethn) that sets Whites to missing and others to either 1 or 2. Then I proceeded with my primary objective to see proportions of 'psysymps' by race and sex and tried "svy: tab blackethn sex, tab (psysymps) row se ci". This gave me the table below.

My questions are: 1) must I always svy set before each code e.g svy: tab instead of just tab?; 2) was it okay to set Whites to missing as they were not asked this question and I dont want them counted as a denominator in my proportion?; 3) the table below still does not give me tabs of my variable by race and sex. how do I do this? Instead the table gave me---of those who answered yes to psysymps, what proportion of race/blackethn =1 were men and what prop were women? I would like to know how to code to get----what proportion of race/blackethn==1 men answered 'yes' to psysymps, compared to race/blackethn== 1 female (and also the proportion of race/blackethn ==2 men that answered yes to to psysymps, compared to race/blackethn== 2 female and associated chi2) 


Number of strata   =        41                  Number of obs      =      5191
Number of PSUs     =        88                  Population size    = 3061.3339
                                               Design df          =        47

-------------------------------------------------------
         |                   rs sex                   
blackethn |          male         female          Total
----------+--------------------------------------------
       1 |         .4019          .5981              1
         |       (.0248)        (.0248)               
         | [.3532,.4526]  [.5474,.6468]               
         | 
       2 |         .5338          .4662              1
         |       (.0579)        (.0579)               
         | [.4176,.6465]  [.3535,.5824]               
         | 
   Total |         .4101          .5899              1
         |       (.0235)        (.0235)               
         | [.3638,.4581]  [.5419,.6362]               
-------------------------------------------------------
 Tabulated variable:  psysymps

 Key:  row proportions
       (linearized standard errors of row proportions)
       [95% confidence intervals for row proportions]

 Pearson:
   Uncorrected   chi2(1)         =   21.8483
   Design-based  F(1, 47)        =    4.6397     P = 0.0364


Thanks so much in advance for your time


Adebola Odunlami, MPH
Doctoral Student
Society, Human Development and Health
Harvard School of Public Health
301 256 4655
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index