Hi stata,

I want to create this "newdummy" based on the following condition.
If the sum of scaledummy >=3 from firmage 1-5 the "newdummy" should be = 1 when firm_age= 0.
Many thanks for help.
year firmid firmage scaledummy new dummy
2001 10 0 0 1
2002 10 1 1 0
2003 10 2 0 0
2004 10 3 1 0
2005 10 4 0 0
2006 10 5 1 0