Hello dear all,
I have a question for generating e new variable exporting. So i want to know the first year in which this firm begin to export, and the year the firm exit form exporting.how can I do? My panel data is unbalanced so may be not all the firm report for these data.. my dataset contains data from 2003-2012. bvdid is the identifier for each firm. export is a dummy var (1 exp; 0 non-exp)
I was thinking of this solution:
bys bvdid: egen minyear=min(year)
bys bvdid: egen maxyear=max(year)
gen entry=0
replace entry=1 if minyear>2003 & year==minyear & export==1
gen exit=0
replace exit=1 if maxyear<2012 & year==maxyear & export==1
what do you think is it correct?
thank a lot
I have a question for generating e new variable exporting. So i want to know the first year in which this firm begin to export, and the year the firm exit form exporting.how can I do? My panel data is unbalanced so may be not all the firm report for these data.. my dataset contains data from 2003-2012. bvdid is the identifier for each firm. export is a dummy var (1 exp; 0 non-exp)
I was thinking of this solution:
bys bvdid: egen minyear=min(year)
bys bvdid: egen maxyear=max(year)
gen entry=0
replace entry=1 if minyear>2003 & year==minyear & export==1
gen exit=0
replace exit=1 if maxyear<2012 & year==maxyear & export==1
what do you think is it correct?
thank a lot
Comment