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: making a variable that count number of certain scores in answer categories
From
Morten Støver <[email protected]>
To
[email protected]
Subject
st: making a variable that count number of certain scores in answer categories
Date
Wed, 04 Jul 2012 12:14:52 +0200
Im writing an article about work environment and disability pension. I
have questions about work environment with three answer categories where
“3” is for people who experience the worst work environment. I'm also
trying to make an aggregated score, and would like a variable where I
count how many scores on “3” each person have. There is probably a very
simple solution to this, but I’m not sure how to code this in Stata.
Let's say John has a friendly work environment and scores:
1,2,1,2,1,2,3,1,3 =John gets an aggregated score of 2
Pete has a poor work environment and scores: 2,3,3,3,2,3,2,3 =Pete gets
an aggregated score of 5
Help is much appreciated.
--
Morten Støver
PhD research fellow
Department of Public Health and General Practice
Norwegian University of Science and Technology
*
* 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/