Hi,

I have the following panel data and I need to generate conditional new variables that equal 1 (yes) or 0 (no), based on the Auditor opinion timing.
I need to generate a variable that equals 1 if Auditor's opinion is 1 for a firm for the first time (some firms have auditor opinion 1 for multiple years, but I need only the ones that happened first time for every firm).
Firm year Auditor opinion (Yes or No)
A 2005 0
A 2006 0
A 2007 1
A 2008 0
A 2009 0
B 2005 0
B 2006 1
B 2007 0
B 2008 0
B 2009 1
B 2010 0
C 2005 0
C 2006 1

Any help would be greatly appreciated!