Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Nick Cox <njcoxstata@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Need help to create variable from list of qualitative variables |
Date | Sun, 6 Mar 2011 14:23:58 +0000 |
egen myvar = rowtotal(var1-var6) replace myvar = 7 - myvar Nick On Sun, Mar 6, 2011 at 12:39 PM, prakash singh <prakashbhu@gmail.com> wrote: > I have six qualitative variable with two options (yes/no) in each > question. Now, I want to create a variable using these six variable > such that the new variable will have value equal to one if for all the > six variables option is yes, then new variable will have value equal > to two if for any five variables option is yes and no for any one of > these.... and so on. * * 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/