Executive Summary

This homework attempts to find if any pattern exists in the return distribution of all the companies within 20 days range around an event date. It’s been observed that, positive excess returns are found ten days before and after the distribution date. No significant return spiked has been found. Therefore, no profit making opportunities are evident in the historical data.

Description of the study

From the following return chart, it seems that investors may be over estimating the true price of stock on the dividend distribution date. Therefore positive excess returns are found around those dates. Further from the event date, excess returns turn more erratic and no consistent profit opportunity can be found based on this data.

Dividend distribution dates and appropriate return data are downloaded frm WRDS. This project required the package dplyr for all data manipulation tasks.

Tables and Figures

After taking arithmetic mean of returns on each relative days, the following excess return plot is generated.

Computer Code

library(rJava)
library(RJDBC)
library(xts)

#login info
username <- "sazz"                                                         
password <- "Bos3wrds"
sasPath <- "C:/wrds-drivers"

#Access to Server
library(rJava)
options(java.parameters = '-Xmx4g')
library(RJDBC)
sasCore <- paste0(sasPath, "/sas.core.jar")
sasDriver <- paste0(sasPath, "/sas.intrnet.javatools.jar")
.jinit()
.jaddClassPath(c(sasCore, sasDriver))
driver <- RJDBC::JDBC("com.sas.net.sharenet.ShareNetDriver", sasDriver, identifier.quote = "`")
wrds <- RJDBC::dbConnect(driver, "jdbc:sharenet://wrds-cloud.wharton.upenn.edu:8551/", username, password)



#Grab Daily
res1 = dbSendQuery(wrds,
                   "select CUSIP,PAYDT,DIVAMT from CRSPQ.DSEDIST where paydt BETWEEN '01jan2012'd and '31dec2012'd")
event = fetch(res1,n=-1)

res2 = dbSendQuery(wrds,
                   "select caldt,vwretd from CRSPQ.DSP500 where caldt BETWEEN '01jan2012'd and '31dec2012'd")
SP500 = fetch(res2,n=-1)

res3 = dbSendQuery(wrds, 
                   "select CUSIP,date,RETX from CRSPQ.DSF where date between '01jan2012'd and '31dec2012'd")
company = fetch(res3,n=-1)
library(dplyr)

#convert to date variables
event$PAYDT = as.Date(event$PAYDT)
company$DATE = as.Date(company$DATE)
SP500$DATE = as.Date(SP500$caldt)
SP500 = SP500[,-1]

#Run a loop through all the payment dates
ret.joined = company%>%
          inner_join(SP500,by = "DATE")%>%
          mutate(excess = RETX-vwretd)


n = 0
span = matrix(0,nrow = 41)

k = dim(event)[1]
for(i in 1:k){
  comp.id = event[i,1]
  dist.dt = event[i,2]
  comp =ret.joined%>%
    filter(CUSIP == comp.id)
  idx = which(comp$DATE == dist.dt)
  if(idx<21 || length(idx)==0){
    next
  }
  
  ret = comp[(idx-20):(idx+20),]$excess
  span = cbind(span,ret)
  n = n+1
}

spandf = data.frame(span)
span.mean = data.frame(rowMeans(spandf[,-1], na.rm = T))
span.mean$days = (seq(-20,20))
colnames(span.mean)[1] <- "excess_returns"

plot( y= span.mean$excess_returns, x = span.mean$days, type = 'l',
      main = " Average Returns around Event date", xlab = "relative days",
      ylab = "excess returns", col = "blue")