PROGRAM EVENT ******************************************************************************* * * * This program performs a standard event study. * * The only user input required is a file called EVENT.INP. This file * * should contain two variables - the CUSIP NUMBER and DATE. * * The format of the file is (1x,a8,1x,i6). The DATE variable is of the * * form yymmdd. (To match up TICKERS or COMPANY NAMES with the CUSIP * * NUMBER, the program EVENTUTIL can be used.) The program * * output is a CAR time series which is in a form suitable for plotting. * * This time series is contained in EVENT.OUT. * * * ******************************************************************************* INCLUDE 'FAMEDISKS:[CRSP.PRG]ALLINCLS.FOR' C---------------------------------------------------------------------- C DECLARE VARIABLES C C IUNIT UNIT NUMBER OF THE CALENDAR/INDEX FILE C JUNIT UNIT NUMBER OF THE DATA FILE C NSEC NUMBER OF SECURITIES READ IN SO FAR c pno CRSP PERMANENT NUMBER from event.inp c evedat event date in event.inp c nsec number of firms read from the CRSP tape c rret stock returns c mret market returns c aret abnormal return c b0 market model intercept c b1 market model beta c nobs counters c i c qq c qqq c t c count c c bef variables used in setting the estimation period c aft these variables are defined below c exc c sta c car cumulative average residual C---------------------------------------------------------------------- DATA IUNIT/10/,JUNIT/11/,NSEC/0/ INTEGER IUNIT,JUNIT,NSEC integer evedat(6000),nobs,i,qqq,qq,t,count integer t1,t2,t3,t4 real rret(2000),mret(2000),aret(2000) real b0,b1,stat(12) real ca,api(2000),car(2000) character*8 csp(6000) ******************************************************************************* * * * THIS SECTION IS THE ONLY PLACE WHERE CHANGES ARE REQUIRED * * * *-----------------------------------------------------------------------------* * First some preliminaries. It is standard in event studies to estimate * * the market model beta over a period which excludes the observations * * around the announcement date. In this section you need to specify the * * period over which the market model beta will be estimated. * * * * For example, you may want to set the beta estimation period to * * (-100,-20) and (+20,+100) and then examine the effect in the 41 * * day window (-20,+20). If so, set t1=-100, t2=-20, t3=20, t4=100. * *-----------------------------------------------------------------------------* * * t1=-100 t2=-20 t3=20 t4=100 * * nobs=(t2-t1)+(t4-t3) * * *-----------------------------------------------------------------------------* * How many firms are in your sample. That is, how many lines in * * EVENT.INP? * *-----------------------------------------------------------------------------* * * ss=7 * * * ******************************************************************************* C---------------------------------------------------------------------- C OPEN CALENDAR AND DATA FILES C---------------------------------------------------------------------- OPEN(UNIT=IUNIT,FILE='FAMEDISKS:[CRSP.UDX]CALENDAR.DAT', & STATUS='OLD',READONLY,SHARED, & ACCESS='SEQUENTIAL',FORM='FORMATTED') REWIND(IUNIT) OPEN(UNIT=JUNIT,FILE='FAMEDISKS:[CRSP.UDX]DATA1.DAT', & STATUS='OLD',READONLY,SHARED, & ACCESS='SEQUENTIAL',FORM='FORMATTED') REWIND(JUNIT) open(unit=8,file='event.out',status='new') open(unit=9,file='event.inp',status='old') C---------------------------------------------------------------------- C READ CALENDAR RECORDS AND RETURN THE NUMBER OF TRADING DATES C IN NDAYS. C---------------------------------------------------------------------- CALL CHCAL(IUNIT) CLOSE (IUNIT, STATUS = 'KEEP') C---------------------------------------------------------------------- C READ ALL THE DATA FOR THE NEXT SECURITY. C---------------------------------------------------------------------- do 500, i=1,ss 90 read(9,1010) csp(i),evedat(i) 1010 FORMAT(1x,a8,1x,i6) 500 continue 100 CALL CHGET(JUNIT,*900) NSEC = NSEC + 1 do 600, i=1,ss if (cusip.ne.csp(i)) goto 600 if ((indxdt(evedat(i))+t1).gt.indxdt(caldt(enddat))) goto 600 if ((indxdt(evedat(i))+t4).lt.indxdt(caldt(begdat))) goto 600 60 j=indxdt(evedat(i)) *********************************************************************** * THESE LINES SET THE BETA ESTIMATION PERIOD * * (t1,t2) AND (t3,t4) * *********************************************************************** do 70 k=1,(t2-t1) qq=j+t1-1+k mret(k)=vwretd(qq) rret(k)=ret(qq) if (rret(k).lt.-50.0) then rret(k)=0.0 endif 70 continue do 80 k=1,(t4-t3) t=(t2-t1)+k qqq=j+t3-1+k mret(t)=vwretd(qqq) rret(t)=ret(qqq) if (rret(k).lt.-50.0) then rret(k)=0.0 endif 80 continue c--------------------------------------------------------------------- c The loops above avoid missing data. In the CRSP files, certain c missing observations are assigned returns of -99.0 etc. c--------------------------------------------------------------------- ********************************************************************** * Compute abnormal returns using an IMSL subroutine. * * Documentation on this subroutine can be found in the IMSL * * STAT Library manual. * ********************************************************************** call rline(nobs,rret,mret,b0,b1,stat) do 91 k=1,(t3-t2+1) z=j+t2-1+k aret(k)=ret(z)-( vwretd(z)*b1+b0 ) ca=ca+aret(k) car(k)=car(k)+ca 91 continue count=count+1 ca=0.0 600 continue C---------------------------------------------------------------------- C READ THE NEXT SECURITY C---------------------------------------------------------------------- GOTO 100 C---------------------------------------------------------------------- C AT THE END OF THE DATA FILE, CLOSE THE FILE AND REPORT THE NUMBER C OF SECURITIES READ. C---------------------------------------------------------------------- 900 do 3000, i=1,(t3-t2+1) write(8,2020) i,car(i)/count 2020 format(1x,i8,1x,f12.6) 3000 continue CLOSE(JUNIT, STATUS = 'KEEP') WRITE(6,1001) NSEC 1001 FORMAT(/1X,I8,' SECURITIES HAVE BEEN PROCESSED.') STOP end