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/