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

st: Number of right answers


From   "Jorge Mendoza A." <[email protected]>
To   "Statalist" <[email protected]>
Subject   st: Number of right answers
Date   Tue, 28 Jan 2003 18:07:43 -0600

Dear Statalist,

In the data I have received, question 15 , for example, has been divided
into n15a....n15j (it means there are 10 vars related to a one
question), with three possible anwers each one (1,2 or 3). One of them
is correct. I would like to generate a variable that counts the number
of correct answers for each record (individual). 

The data looks like:

N15a   n15b  n15c  n15d ......    Newvar (# of correct answers)
  1     2     3     1               3
  1     1     2     1               3
  1     2     2     1               4
  2     3     1     2               0
  3     2     1     3               1

As we can see the right answer is not the same for all variables, 3 is a
"don't know" answer. Thus, for question n15a, the correct answer is 1;
for n15b is 2; for n15c is 2; for n15d is 1, etc.

Can somebody help me with this?

Jorge


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index