Hello stata users,

I am having a panel of groups and need to filter them to positive and not positive based on an index which takes both positive and not positive values ranging from 10 to -10. Each group is assigned in this dataset a value that ranges from -10 to 10 (the highest level). I need to create dummies of " new and "old" based on the observations with a non-negative score in an index. The sample sample will be split between these groups with a score of 0 to 9 and those with a score of 10, There I need to separate those groups that had competitive events during the entire sample period for which I have data from those that began having competitive events only within the sample period.. For the latter, I need to take observations for the first four competitive events and define those observations as coming from a “new" .

A small sample of my data are given below.


I would much appreciate your help and thank you in advanced for your inputs!




----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input int Time str15 group float event_date int event_year float event byte index
1974 "Group A"  5434 1974 1  1
1975 "Group A"  5434 1974 0  8
1976 "Group A"  5434 1974 0  8
1977 "Group A"  6533 1977 1  8
1978 "Group A"  6533 1977 0  8
1979 "Group A"  6533 1977 0  8
1980 "Group A"  6533 1977 0  8
1981 "Group A"  7961 1981 1  8
1982 "Group A"  7961 1981 0  8
1983 "Group A"  7961 1981 0  8
1984 "Group A"  7961 1981 0  8
1985 "Group A"  9284 1985 1  8
1986 "Group A"  9284 1985 0 10
1987 "Group A"  9284 1985 0 10
1988 "Group A"  9284 1985 0 10
1989 "Group A" 10901 1989 1 10
1990 "Group A" 11055 1990 1 10
1991 "Group A" 11055 1990 0 10
1992 "Group A" 11055 1990 0 10
1993 "Group A" 12336 1993 1 10
1994 "Group A" 12336 1993 0 10
1995 "Group A" 12336 1993 0 10
1996 "Group A" 13414 1996 1 10
1997 "Group A" 13414 1996 0 10
1998 "Group A" 13414 1996 0 10
1999 "Group A" 13414 1996 0 10
2000 "Group A" 14709 2000 1 10
end
format %ty Time
format %d event_date
------------------ copy up to and including the previous line ------------------