Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Use 2 variables to gen 10 new variables


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Use 2 variables to gen 10 new variables
Date   Wed, 27 Jul 2011 19:15:19 +0100

This sounds very ad hoc. Consider instead the possibilities for producing new reduced datasets by -contract- and -collapse-. 

Nick 
n.j.cox@durham.ac.uk 

Jonathan Grondin

I have a questionnaire answered by two groups (group "a" and group "b"). 
Every question had to be answered by a value of 1 through 10. Every question is then divided into 2 variables, e.g Question 1: "q1a" and "q1b".

I would like to combine q1a and q1b together and create 10 variables out of them each of them holding the frequency of the two groups. e.g. "q1a" and "q1b" would generate: "new_q1_1" to "new_q1_10".
Every new variable would hold two values: new_q1_1 would hold the frequency of people in group "a" who answered "1" and the frequency of people in group "b" who answered "1".


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index