# Generate variable that shows the question with the highest correct answers

#### Marvin85

##### Member
hi friends,

I asked 25 questions in a test.

q1
1=correct
0=incorrect

q2
1=correct
0=incorrect

So on,

I would like to know which of the 25 question has the most correct responses. I could tab each variable and know the answer but is there a way to create a new variable with this info? Perhaps egen, somenthing??
In order words I would like a single table with the frequencies of the 25 variables
new var
q1=12
q2=25
q3=23

so on...

reshape long q, i(id) j(question)
tab question correct