Obsidian | Level 7

## Help with regression - changing time dimentions, fixed-effects, diff in diff

Hello

I am interested in estimating a regression where I use diff in diff following an IPO event, based on a certain factor. The estimation is for 3 years windows before and after an IPO event.

meaning:

sales= b1+b2*Post_IPO+b3*Factor+b4*Post_IPO*Factor

The coefficient of interest is b4.

The data I have after the calculation of the factor manipulation is of the following structure:

The original sample is a "usual" panel data. I use an overlapping dataset but treat each IPO year sample as independent (see table below). So, for example, for year 1991 I have two observations for firm a: one for the 1993 IPO and one for the 1994 IPO.

 t company year sales Post Ipo year ipo factor y-3 a 1990 k1 0 1993 0.8 y-2 a 1991 k2 0 1993 0.8 y-1 a 1992 k3 0 1993 0.8 y a 1993 k4 0 1993 0.8 y+1 a 1994 k5 1 1993 0.8 y+2 a 1995 k6 1 1993 0.8 y+3 a 1996 k7 1 1993 0.8 y-3 a 1991 l1 0 1994 0.5 y-2 a 1992 l2 0 1994 0.5 y-1 a 1993 l3 0 1994 0.5 y a 1994 l4 0 1994 0.5 y+1 a 1995 l5 1 1994 0.5 y+2 a 1996 l6 1 1994 0.5 y+3 a 1997 l7 1 1994 0.5

I am not sure how to adress this dataset in SAS if I want to add year and firm fixed effects and if I want to capture the 3 year difference I am interested in.

I thought about creating a new variable :company_year_IPO: a_1993, a_1994 and define class by company_year_IPO, year... but then how can I add firm fixed effects?

Thanks!!!

3 REPLIES 3
Diamond | Level 26

## Re: Help with regression - changing time dimentions, fixed-effects, diff in diff

In the first record, sales is K1. Shouldn't there be a number there?

Is the problem that you don't know how to compute three year differences in SAS? Can you show us which three year differences you want, using sample of data (it can be made up data), addressing this K1 issue? Show us what you think it should be, then we can tell you how to program it.

--
Paige Miller
Obsidian | Level 7

## Re: Help with regression - changing time dimentions, fixed-effects, diff in diff

K1 represents a number (I used parameters for convinience..), as well as k2,k3...l1...l7 - they all represent numbers.
The code I thought to use to get this Diff-in-Diff with firm and yearf ixed effects is something of the following:
1. First, I will create a new identifier for firm_ipo year and get data of this kind (to create a panel data):
t company year sales year ipo correlation firm_ipo_year
y-3 a 1990 number 1 1993 0.8 a_1993
y-2 a 1991 number 2 1993 0.8 a_1993
y-1 a 1992 number 3 1993 0.8 a_1993
y a 1993 number 4 1993 0.8 a_1993
y+1 a 1994 number 5 1993 0.8 a_1993
y+2 a 1995 number 6 1993 0.8 a_1993
y+3 a 1996 number 7 1993 0.8 a_1993
y-3 a 1991 number 2 1994 0.5 a_1994
y-2 a 1992 number 3 1994 0.5 a_1994
y-1 a 1993 number 4 1994 0.5 a_1994
y a 1994 number 5 1994 0.5 a_1994
y+1 a 1995 number 6 1994 0.5 a_1994
y+2 a 1996 number 7 1994 0.5 a_1994
y+3 a 1997 number 8 1994 0.5 a_1994

2. Use GLM:
This is where I am not sure how to handle the data.
When treating this like panel, the t is year and the i is firm_ipo_year, but I am interestred in fixed effects for year and firm, not firm_ipo_year.

Does this fit?
proc sort data=dataset;
by firm;
proc glm data=dataset;
absorb firm;
class firm_ipo_year year;
model sales = independent_variables year / solution;

Or, should I use a different command?
Obsidian | Level 7