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: how to assign an indicator variable to all observation within a group if a condition is satisfied at least twice
From
Nahla Betelmal <[email protected]>
To
[email protected]
Subject
st: how to assign an indicator variable to all observation within a group if a condition is satisfied at least twice
Date
Fri, 28 Jun 2013 17:42:37 +0100
Hi again,
I want to identify two groups of managers. Group one represents
managers who have earnings => 100 at least twice during their tenure
period. the other group (the reference one) represent manages who have
earnings less than 100 or achieved 100 only once during their tenure
period.
for example, I want to assign an indicator variable =1 for manager
A187, and zero for managers B963 and C425 as the following:
year manager_ID Earnings indicator
1995 A187 100 1
1996 A187 150 1
1997 A187 60 1
1998 A187 0 1
year manager_ID Earnings indicator
1995 B963 30 0
1996 B963 20 0
1997 B963 100 0
1998 B963 0 0
year manager_ID Earnings indicaror
1997 C425 70 0
1998 C425 90 0
Thanks in advance
Nahla Betelmal
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/