Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Maarten Buis <maartenlbuis@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: making a variable that count number of certain scores in answer categories |
Date | Wed, 4 Jul 2012 12:34:02 +0200 |
On Wed, Jul 4, 2012 at 12:14 PM, Morten Støver <morten.stover@ntnu.no> wrote: > 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. Assuming that the scores are stored in variables score1-score9 than you can type: egen agg_score = anycount(score1-score9), value(3) Hope this helps, Maarten -------------------------- Maarten L. Buis Institut fuer Soziologie Universitaet Tuebingen Wilhelmstrasse 36 72074 Tuebingen Germany http://www.maartenbuis.nl -------------------------- * * 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/