Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Socio-economic multi-variable analysis


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   Re: st: Socio-economic multi-variable analysis
Date   Fri, 08 Dec 2006 10:46:25 -0500

I assume that you variables are named q48a-q48k since you can not start a variable name with a number in Stata (aside--why do people seem to misquote their own data so often on Statalist??). Anyway, this should do what you want and create one long list with lines dividing it by number of yes answers.

egen numyes=rsum(q48q-q48k)
sort numyes
l idno numyes , sepby(numyes)

M Blasnik

----- Original Message ----- From: "Todd Swarthout" <[email protected]>
To: <[email protected]>
Sent: Friday, December 08, 2006 9:17 AM
Subject: RE: st: Socio-economic multi-variable analysis



Im sorry, let me try to explain again...I suspect the answer is quite easy.

I have 350 questionnaires, each with an ID number (variable = idno). Each questionnaire can have up to 11 total yes responses to the 11 questions having to do with socio-ecinomic status (variables 48a - 48k). I would like to know for each ID number how many yes ('1') respondes there are within these 11 questions...without having to do a command for each ID number.

Maybe something like "list idno if 48a-48k 'contain' 1 yes responses"...and then perhaps I could do this command for each possible number of 'yes' responses.

"list idno if 48a-48k 'contain' 1 yes responses"
"list idno if 48a-48k 'contain' 2 yes responses"
"list idno if 48a-48k 'contain' 3 yes responses"

Etc...

In the end Id like the table

ID No./ No. 'yes' responses in questions 48a - 48k
/
/
*
*   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