BookmarkSubscribeRSS Feed
margalits1
Obsidian | Level 7

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.

 

 

tcompanyyear salesPost Ipoyear ipo factor
y-3a1990k1019930.8
y-2a1991k2019930.8
y-1a1992k3019930.8
ya1993k4019930.8
y+1a1994k5119930.8
y+2a1995k6119930.8
y+3a1996k7119930.8
y-3a1991l1019940.5
y-2a1992l2019940.5
y-1a1993l3019940.5
ya1994l4019940.5
y+1a1995l5119940.5
y+2a1996l6119940.5
y+3a1997l7119940.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
PaigeMiller
Diamond | Level 26

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
margalits1
Obsidian | Level 7
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?
margalits1
Obsidian | Level 7
Hi again, any ideas ? (I eleborated about what you asked)

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 414 views
  • 0 likes
  • 2 in conversation