Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: multiple response question


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: multiple response question
Date   Tue, 22 Oct 2002 14:32:48 +0100

Phung Lang
> 
> I have a question which consists of two parts (A and B) in 
> which multiple
> responses are allowed for each part. (The 9 possible 
> choices in part A are
> identical to those in B). 1) How can I get STATA to compute 
> the frequencies
> so that the total percentages of the 9 choices (variables) 
> equal 100%, for
> each part.  

You need a data structure in which each response is 
a value in a single variable, something like this: 

id   choice  
1       3 
1       5
1       9 
2       2 
2       7 

Then you can 

. tab choice 

In some circumstances you might want to
weight by 1 / # choices, 
so the total is # individuals. 

. bysort id : gen byte nchoices = _N 
. tab choice  [aw=1/id] 

If your data are not in this structure, 
you may need to -reshape-. 

2) Using the new data generated from question 
> 1, how can I get
> STATA to calculate the chi square to compare the same 
> variable in Parts A
> and B? Because this is a multiple response question, I am 
> assuming that I
> cannot simply state that "1" equals selected and "0", not 
> selected.  Or can I?

I am not clear what chi-square testing you can do 
with such data. 

Nick 
n.j.cox@durham.ac.uk 
*
*   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