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]
Re: st: making a variable that count number of certain scores in answer categories
From
Maarten Buis <[email protected]>
To
[email protected]
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 <[email protected]> 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/