forked from tevgeniou/BuybacksIssuers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoolreport.Rnw
502 lines (394 loc) · 31.2 KB
/
toolreport.Rnw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
<< eval = TRUE, echo=FALSE,message=FALSE,fig.pos='h',results='asis' >>=
load("bb_issuersTOOL.Rdata")
run_shiny_tool = 1
if(run_shiny_tool) suppressPackageStartupMessages({
library(Rcpp)
library(RcppArmadillo)
library(stringr)
library(gtools)
library(timeDate)
library(Hmisc)
})
library(knitr)
opts_chunk$set(cache=FALSE)
inline_hook <- function (x) {
if (is.numeric(x)) {
# ifelse does a vectorized comparison
# If integer, print without decimal; otherwise print two places
res <- ifelse(x == round(x),
# use comma for 1000s
sprintf("%s", prettyNum(x, big.mark=",")),
sprintf("%.2f", x)
)
paste(res, collapse = ", ")
} else {
x
}
}
knit_hooks$set(inline = inline_hook)
###
suppressPackageStartupMessages(source("lib_helpers.R", chdir=TRUE))
source("latex_code.R")
source("ff_industries_sic.R")
source("Paper_global_parameters.R")
# All the report parameters
startdate = report.list$startdate
enddate= report.list$enddate
market_cap_min = report.list$market_cap_min
market_cap_max= report.list$market_cap_max
industry = report.list$industry
characteristic= report.list$characteristic
characteristic_single_analysis= report.list$characteristic_single_analysis
quantile_used = report.list$quantile_used
characteristic_single_analysis_sign= report.list$characteristic_single_analysis_sign
high_EU_index_thres= report.list$high_EU_index_thres
low_EU_index_thres= report.list$low_EU_index_thres
quantile_used_ind= report.list$quantile_used_ind
quantile_used_all= report.list$quantile_used_all
characteristic_irats1= report.list$characteristic_irats1
characteristic_irats2= report.list$characteristic_irats2
characteristic_irats3= report.list$characteristic_irats3
characteristic_irats4= report.list$characteristic_irats4
characteristic_irats5= report.list$characteristic_irats5
characteristic_irats6= report.list$characteristic_irats6
characteristic_irats1_sign= report.list$characteristic_irats1_sign
characteristic_irats2_sign= report.list$characteristic_irats2_sign
characteristic_irats3_sign= report.list$characteristic_irats3_sign
characteristic_irats4_sign= report.list$characteristic_irats4_sign
characteristic_irats5_sign= report.list$characteristic_irats5_sign
characteristic_irats6_sign = report.list$characteristic_irats6_sign
###
@
<< eval = TRUE, echo=FALSE,message=FALSE,fig.pos='h',results='asis' >>=
# Filter the data now - as in Index.rmd
FirstTrade = startdate
starting = startdate
ending = enddate
if (ending - starting < 3*365)
ending = starting + 3*365
market_cap_min = as.numeric(market_cap_min)
market_cap_max = as.numeric(market_cap_max)
if (market_cap_max < market_cap_min)
market_cap_max = ceiling(max(BUYBACK_DATA_TOOL$Market.Cap))
useonly_industry = !(BUYBACK_DATA_TOOL$Industry_name %in% industry)
useonly_report = which(BUYBACK_DATA_TOOL$Event.Date >= starting & BUYBACK_DATA_TOOL$Event.Date <= ending &
scrub(BUYBACK_DATA_TOOL$Market.Cap) >= market_cap_min &
scrub(BUYBACK_DATA_TOOL$Market.Cap) <= market_cap_max &
useonly_industry)
value.weights = rep(1, length(BUYBACK_DATA_TOOL$Prior.Returns.Score))
DATASET_NEW = list(
BUYBACK_DATA_TOOL=BUYBACK_DATA_TOOL[useonly_report,],
returns_by_event_monthly = returns_by_event_monthly[,useonly_report],
DatesMonth = DatesMonth[,useonly_report],
value.weights = value.weights[useonly_report],
subset = useonly_report
)
@
<< eval = TRUE, echo=FALSE,message=FALSE,fig.pos='h',results='asis' >>=
firstyear = as.character(format(startdate,"%Y"))
lastyear = as.character(format(enddate,"%Y"))
report_months_cal = c(as.numeric(reported_times[1:(length(reported_times)-1)]),1)
value.weights = rep(1,length(BUYBACK_DATA_TOOL$Prior.Returns.Score))
@
\documentclass{article}
\usepackage{setspace}
\usepackage{hyperref}
\usepackage{float}
\begin{document}
\title{\textbf{Volatility and the Buyback Anomaly: Online Interactive Tool Report}}%\footnotetext{}
\author{\uppercase{ Theodoros Evgeniou$^*$, Enric Junqu\'e de Fortuny$^{**}$,\\
Nick Nassuphis$^{***}$,} and \uppercase{Theo Vermaelen}\thanks{INSEAD, Bd de Constance, 77300 Fontainebleau, France, phone: +33(0)1 6072 4000, $^{**}$Rotterdam School of Management, Burgemeester Oudlaan 50, 3062 PA Rotterdam, The Netherlands, $^{***}$31, St. Martin's Lane WC2N 4ER London, United Kingdom, e-mail: \href{mailto:theodoros.evgeniou@insead.edu}{theodoros.evgeniou@insead.edu}, \href{mailto:enric.junquedefortuny@insead.edu}{enric.junquedefortuny@rsm.nl}, \href{mailto:nicknassuphis@gmail.com}{nicknassuphis@gmail.com}, and \href{mailto:theo.vermaelen@insead.edu}{theo.vermaelen@insead.edu}. }}
\date{\today} % No date for final submission
% Create title page with no page number
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\singlespacing
\maketitle
\vspace{-.2in}
\begin{abstract}
\noindent This is a customized report of the online interactive tool for the paper {\it ``Volatility and the Buyback Anomaly''} by T. Evgeniou, Enric Junqu\'e de Fortuny, Nick Nassuphis, and Theo Vermaelen.
There is no guarantee that there is no error in all possible customized reports.
\end{abstract}
%\vspace{2cm}
\medskip
%\noindent \textit{Keywords}: Share Buybacks; Seasoned Equity Offerings; Anomalies; Volatility
\thispagestyle{empty}
\setcounter{page}{1}
\doublespacing
\section{Report Parameters}
\label{sec:parameters}
The time period used in this report is from \Sexpr{startdate} to \Sexpr{enddate}. We only consider firms with a market capitalization the month before the event being between \Sexpr{market_cap_min} and \Sexpr{market_cap_max}. In addition to the financial and utilities sectors, we also remove the following sectors: \Sexpr{ifelse(length(industry) == 0, "None", paste(industry, collapse=", "))}. This leaves a total of \Sexpr{length(DATASET_NEW$value.weights)} buyback events.
\section{\Sexpr{gsub("\\.", " ", characteristic_single_analysis)} and Excess Returns}
We consider the IRATS Cumulative Abnormal Returns (CAR) and Calendar Time method Abnormal Returns (AR) of the high and low quantiles of events defined using the selected event characteristic, namely \Sexpr{gsub("\\.", " ", characteristic_single_analysis)}. Table \ref{tbl:indcharacteristic} shows the results. Figure \ref{fig:indcharacteristic} shows the excess returns of a strategy that trades only the high or low percentile stocks for this event characteristic (the strategy is designed as described in the paper). Table \ref{tbl:indcharacteristicpnl} shows the monthly and yearly returns of the high percentile events strategy.
<< eval = TRUE, echo=FALSE,message=FALSE,fig.pos='h',results='asis' >>=
# FOllowing Index.Rmd, generate first the tables as needed
thesign = ifelse(characteristic_single_analysis_sign, -1, +1)
thefeature = thesign*DATASET_NEW$BUYBACK_DATA_TOOL[[which(names(DATASET_NEW$BUYBACK_DATA_TOOL) == characteristic_single_analysis)]]
thefeatureQ = thesign*BUYBACK_DATA_TOOL[[which(names(BUYBACK_DATA_TOOL) == characteristic_single_analysis)]]
quantile_used_ind = as.numeric(quantile_used)
High_feature_events = !is.na(thefeature) & scrub(thefeature) >= quantile(scrub(thefeatureQ[!is.na(thefeatureQ)]),1-quantile_used_ind)
Low_feature_events = !is.na(thefeature) & scrub(thefeature) <= quantile(scrub(thefeatureQ[!is.na(thefeatureQ)]),quantile_used_ind)
res = round(cbind(
car_table(DATASET_NEW$returns_by_event_monthly[, Low_feature_events],
DATASET_NEW$BUYBACK_DATA_TOOL$Event.Date[ Low_feature_events],Risk_Factors_Monthly,formula_used = five_factor_model)$results,
car_table(DATASET_NEW$returns_by_event_monthly[, High_feature_events],
DATASET_NEW$BUYBACK_DATA_TOOL$Event.Date[High_feature_events],Risk_Factors_Monthly,formula_used = five_factor_model)$results
),2)[reported_times,]
colnames(res) <- c("Low: CAR", "t-stat","p-value", "High: CAR", "t-stat","p-value")
feature_IRATStable = as.data.frame(res)
##
thesign = ifelse(characteristic_single_analysis_sign, -1, +1)
thefeature = thesign*DATASET_NEW$BUYBACK_DATA_TOOL[[which(names(DATASET_NEW$BUYBACK_DATA_TOOL) == characteristic_single_analysis)]]
thefeatureQ = thesign*BUYBACK_DATA_TOOL[[which(names(BUYBACK_DATA_TOOL) == characteristic_single_analysis)]]
quantile_used_ind = as.numeric(quantile_used)
High_feature_events = !is.na(thefeature) & scrub(thefeature) >= quantile(scrub(thefeatureQ[!is.na(thefeatureQ)]),1-quantile_used_ind)
Low_feature_events = !is.na(thefeature) & scrub(thefeature) <= quantile(scrub(thefeatureQ[!is.na(thefeatureQ)]),quantile_used_ind)
res = round(cbind(
calendar_table(DATASET_NEW$returns_by_event_monthly[, Low_feature_events],
DATASET_NEW$BUYBACK_DATA_TOOL$Event.Date[Low_feature_events],Risk_Factors_Monthly,formula_used = five_factor_model, value.weights = DATASET_NEW$value.weights[Low_feature_events])$results,
calendar_table(DATASET_NEW$returns_by_event_monthly[,High_feature_events],
DATASET_NEW$BUYBACK_DATA_TOOL$Event.Date[High_feature_events],Risk_Factors_Monthly,formula_used = five_factor_model, value.weights = DATASET_NEW$value.weights[High_feature_events])$results
),2)[reported_times,]
colnames(res) <- c("Low: CAL", "t-stat","p-value", "High: CAL", "t-stat","p-value")
feature_CALtable= as.data.frame(res)
##
thesign = ifelse(characteristic_single_analysis_sign, -1, +1)
thefeature = thesign*DATASET_NEW$BUYBACK_DATA_TOOL[[which(names(DATASET_NEW$BUYBACK_DATA_TOOL) == characteristic_single_analysis)]]
thefeatureQ = thesign*BUYBACK_DATA_TOOL[[which(names(BUYBACK_DATA_TOOL) == characteristic_single_analysis)]]
quantile_used_ind = as.numeric(quantile_used)
High_feature_events = !is.na(thefeature) & scrub(thefeature) >= quantile(scrub(thefeatureQ[!is.na(thefeatureQ)]),1-quantile_used_ind)
High_feature <- apply(PNL_matrix_BB(start_date_event,"One.Year.After", High_feature_events, DATASET_NEW$DatesMonth, DATASET_NEW$returns_by_event_monthly,event=1),1,non_zero_mean)
High_feature_Hedged_react = remove_initialization_time(suppressWarnings(scrub(alpha_lm(High_feature,Risk_Factors_Monthly[,pnl_hedge_factors],hedge_months,trade=1))),min_date=FirstTrade)
##
thesign = ifelse(characteristic_single_analysis_sign, -1, +1)
thefeature = thesign*DATASET_NEW$BUYBACK_DATA_TOOL[[which(names(DATASET_NEW$BUYBACK_DATA_TOOL) == characteristic_single_analysis)]]
thefeatureQ = thesign*BUYBACK_DATA_TOOL[[which(names(BUYBACK_DATA_TOOL) == characteristic_single_analysis)]]
quantile_used_ind = as.numeric(quantile_used)
Low_feature_events = !is.na(thefeature) & scrub(thefeature) <= quantile(scrub(thefeatureQ[!is.na(thefeatureQ)]),quantile_used_ind)
Low_feature <- apply(PNL_matrix_BB(start_date_event,"One.Year.After", Low_feature_events, DATASET_NEW$DatesMonth, DATASET_NEW$returns_by_event_monthly,event=1),1,non_zero_mean)
Low_feature_Hedged_react = remove_initialization_time(suppressWarnings(scrub(alpha_lm(Low_feature,Risk_Factors_Monthly[,pnl_hedge_factors],hedge_months,trade=1))),min_date=FirstTrade)
@
\clearpage
<< eval = TRUE, echo=FALSE,message=FALSE,fig.pos='h',results='asis' >>=
tmp = cbind(feature_IRATStable,feature_CALtable)[reported_times,]
colnames(tmp)[1]<-colnames(tmp)[4] <- "CAR"
printLatexTable(
tmp,
columns = c("IRATS CAR: LOW","HIGH","Calendar Time AR: LOW","HIGH"),
title= paste("Buyback IRATS and Calendar Time Abnormals Returns for ",gsub("\\."," ", characteristic_single_analysis),sep=" "),
caption= "The tables presents the abnormal returns for firms after repurchase announcements from the announcement date until $t$ months after the announcement. Left tables report monthly cumulative average abnormal returns (CAR) in percent using Ibbotson (1975) returns across time and security (IRATS) method combined with the Fama French (2015) five-factor model for the low and high prcentile sample of firms using the selected ctiretion that announced an open market share repurchase. The following regressions are run each event month~$j$:
\\begin{eqnarray*}
(R_{i,t} - R_{f,t}) &=& a_j + b_j (R_{m,t} - R_{f,t}) + c_j {SMB}_t + d_j {HML}_t + \\epsilon_{i,t}, \\\\
(R_{i,t} - R_{f,t}) &=& a_j + b_j (R_{m,t} - R_{f,t}) + c_j {SMB}_t + d_j {HML}_t + e_t {RMW}_t + f_t {CMA}_t + \\epsilon_{i,t},
\\end{eqnarray*}
where $R_{i,t}$ is the monthly return on security $i$ in the calendar month $t$ that corresponds to the event month $j$, with $j = 0$ being the month of the repurchase announcement. $R_{f,t}$ and $R_{m,t}$ are the risk-free rate and the return on the equally weighted CRSP index, respectively. ${SMB}_t$, ${HML_t}$, ${RMW}_t$, ${CMA}_t$ are the monthly returns on the size, book-to-market factor, profitability factor and investment factor in month $t$, respectively. The numbers reported are sums of the intercepts of cross-sectional regressions over the relevant event-time-periods expressed in percentage terms. The standard error (denominator of the $t$-statistic) for a window is the square root of the sum of the squares of the monthly standard errors. Right tables report monthly average abnormal returns (AR) of equally weighted Calendar Time portfolios using the Fama and French (2015a) five-factor model. In this method, event firms that have announced an open market buyback in the last calendar months form the basis of the calendar month portfolio. A single time-series regression is run with the excess returns of the calendar portfolio as the dependent variable and the returns of five factors as the independent variables. The significance levels are indicated by +, *, and ** and correspond to a significance level of $10\\%$, $5\\%$, and $1\\%$ respectively, using a two-tailed test.
",
label = "tbl:indcharacteristic",
titleontop=T,
metric = "Ret.",
scale=1,
lastSpecial=T#,
#dorotate=F
)
@
\clearpage
\begin{figure}[H]
\centering
<< BBISSpnl1, fig.width=10, fig.height=7, out.width='\\textwidth', echo=F >>=
plot(cumsum(100*Low_feature_Hedged_react),type="l",ylab="CAR", xlab = "",main = paste("Excess Returns of a Buyback Strategy based on ",gsub("\\."," ", characteristic_single_analysis),sep=" "), axes = FALSE, ylim=c(min(c(100*cumsum(Low_feature_Hedged_react),cumsum(100*High_feature_Hedged_react))), max(c(cumsum(100*Low_feature_Hedged_react),cumsum(100*High_feature_Hedged_react)))), cex.lab=1.1)
axis(1,at=seq(1,length(Low_feature_Hedged_react),length.out=10),labels=str_sub(names(Low_feature_Hedged_react)[seq(1,length(Low_feature_Hedged_react),length.out=10)], start = 1, end=4),cex.axis=1,las=3)
axis(2,cex.axis=1.1)
lines(cumsum(100*High_feature_Hedged_react), lty = 2,lwd=1.4)
for (iter in floor(100*min(c(cumsum(Low_feature_Hedged_react),cumsum(High_feature_Hedged_react)))/100):floor(100*max(c(cumsum(Low_feature_Hedged_react),cumsum(High_feature_Hedged_react)))/100))
abline(h = 100*iter)
#plot_crisis_dates(Low_feature_Hedged_react)
legend(x="topleft",
c("High Quantile","Low Quantile"),
lty=c("solid","dashed"),
lwd=c(2,2),
cex=1,bg="white",inset=0.01)
@
\caption{Buybacks: Returns of five-factor rolling hedged portfolio for only the buyback events for high and low percentile events. Solid line is ``high'' and a 12-months holding portfolio, dotted line is ``low'' and a 12-months holding portfolio.
}
\label{fig:indcharacteristic}
\end{figure}
\clearpage
<< eval = TRUE, echo=FALSE,message=FALSE,fig.pos='h',results='asis' >>=
latex_render_data_frame(
pnl_matrix(remove_initialization_time(High_feature_Hedged_react,min_date=FirstTrade)),
title = paste("Monthly and Yearly Five Factor Abnormal Rerurns of a strategy investing in the high percentile buybacks defined using the event characteristic",gsub("\\."," ", characteristic_single_analysis), sep=" "),
caption="Monthly and yearly five-factor rolling hedged abnormal returns of an equally weighted (with monthly rebalancing) portfolio of selected buybacks. The holding period for each buyback is 12 months per event.",
label="tbl:indcharacteristicpnl",
columns=NULL,
bigtitleontop = T,
show_rownames=TRUE,
scale = 0.9,
digits=1,
lastSpecial=F#,dorotate=F
)
@
\clearpage
\section{Customized Undervaluation Indicator and Excess Returns}
We define a customized Undervaluation index using the following event characteristics: \Sexpr{ifelse(characteristic_irats1 != "None", paste(gsub("\\.", " ", characteristic_irats1), " (sign is ", ifelse(characteristic_irats1_sign, "-1","+1"),")",collapse = ""), "") } \Sexpr{ifelse(characteristic_irats2 != "None", paste(",", gsub("\\.", " ", characteristic_irats2), " (sign is ", ifelse(characteristic_irats2_sign, "-1","+1"),")",collapse = ""), "") } \Sexpr{ifelse(characteristic_irats3 != "None", paste(",", gsub("\\.", " ", characteristic_irats3), " (sign is ", ifelse(characteristic_irats3_sign, "-1","+1"),")",collapse = ""), "") } \Sexpr{ifelse(characteristic_irats4 != "None", paste(",", gsub("\\.", " ", characteristic_irats4), " (sign is ", ifelse(characteristic_irats4_sign, "-1","+1"),")",collapse = ""), "") } \Sexpr{ifelse(characteristic_irats5 != "None", paste(",", gsub("\\.", " ", characteristic_irats5), " (sign is ", ifelse(characteristic_irats5_sign, "-1","+1"),")",collapse = ""), "") } \Sexpr{ifelse(characteristic_irats6 != "None", paste(",", gsub("\\.", " ", characteristic_irats6), " (sign is ", ifelse(characteristic_irats6_sign, "-1","+1"),")",collapse = ""), "") }. For each of these characteristics we define the high and low events as those that are in the top or bottom \Sexpr{100*quantile_used_ind}$\%$ of the events. We then assign a score of 2 for the high, 0 for the low, and 1 for the rest of the events for each of these characteristics, and we add up these scores to create the customized undervaluation index. Figure \ref{fig:undervaluationindex} shows the number of events for each of the values of this customized index.
We then consider the IRATS Cumulative Abnormal Returns (CAR) and Calendar Time method Abnormal Returns (AR) of the high/low quantiles of events defined using this customized Undervaluation Index. Table \ref{tbl:CUcharacteristic} shows the results. Figure \ref{fig:CUcharacteristic} shows the excess returns of a strategy that trades only the high or low percentile stocks for this customized undervaluation index (the strategy is designed as described in the paper). Table \ref{tbl:CUcharacteristicpnl} shows the monthly and yearly returns of the high percentile events strategy.
<< eval = TRUE, echo=FALSE,message=FALSE,fig.pos='h',results='asis' >>=
thesign = ifelse(characteristic_irats1_sign, -1, +1)
thefeature1 = (thesign==-1) + thesign*DATASET_NEW$BUYBACK_DATA_TOOL[[which(names(DATASET_NEW$BUYBACK_DATA_TOOL) == characteristic_irats1)]]
thefeature1Q = (thesign==-1) + thesign*BUYBACK_DATA_TOOL[[which(names(BUYBACK_DATA_TOOL) == characteristic_irats1)]]
High_feature_events1 = (scrub(thefeature1) >= quantile(thefeature1Q[!is.na(thefeature1Q)],1-as.numeric(quantile_used_ind)) & !is.na(thefeature1))
Low_feature_events1 = (scrub(thefeature1) <= quantile(thefeature1Q[!is.na(thefeature1Q)],as.numeric(quantile_used_ind)) & !is.na(thefeature1))
thefeature2 <- thefeature3 <- thefeature4 <- thefeature5 <- thefeature6 <- rep(0,length(High_feature_events1))
High_feature_events2 <- High_feature_events3 <- High_feature_events4 <- High_feature_events5 <- High_feature_events6 <- rep(FALSE,length(High_feature_events1))
Low_feature_events2 <- Low_feature_events3 <- Low_feature_events4 <- Low_feature_events5 <- Low_feature_events6 <-
rep(FALSE,length(Low_feature_events1))
if (characteristic_irats2 != "None"){
thesign = ifelse(characteristic_irats2_sign, -1, +1)
thefeature2 = (thesign==-1) + thesign*DATASET_NEW$BUYBACK_DATA_TOOL[[which(names(DATASET_NEW$BUYBACK_DATA_TOOL) == characteristic_irats2)]]
thefeature2Q = (thesign==-1) + thesign*BUYBACK_DATA_TOOL[[which(names(BUYBACK_DATA_TOOL) == characteristic_irats2)]]
High_feature_events2 = (scrub(thefeature2) >= quantile(thefeature2Q[!is.na(thefeature2Q)],1-as.numeric(quantile_used_ind)) & !is.na(thefeature2))
Low_feature_events2 = (scrub(thefeature2) <= quantile(thefeature2Q[!is.na(thefeature2Q)],as.numeric(quantile_used_ind)) & !is.na(thefeature2))
}
if (characteristic_irats3 != "None"){
thesign = ifelse(characteristic_irats3_sign, -1, +1)
thefeature3 = (thesign==-1) + thesign*DATASET_NEW$BUYBACK_DATA_TOOL[[which(names(DATASET_NEW$BUYBACK_DATA_TOOL) == characteristic_irats3)]]
High_feature_events3 = (scrub(thefeature3) >= quantile(thefeature3[!is.na(thefeature3)],1-as.numeric(quantile_used_ind)) & !is.na(thefeature3))
Low_feature_events3 = (scrub(thefeature3) <= quantile(thefeature3[!is.na(thefeature3)],as.numeric(quantile_used_ind)) & !is.na(thefeature3))
}
if (characteristic_irats4 != "None"){
thesign = ifelse(characteristic_irats4_sign, -1, +1)
thefeature4 = (thesign==-1) + thesign*DATASET_NEW$BUYBACK_DATA_TOOL[[which(names(DATASET_NEW$BUYBACK_DATA_TOOL) == characteristic_irats4)]]
High_feature_events4 = (scrub(thefeature4) >= quantile(thefeature4[!is.na(thefeature4)],1-as.numeric(quantile_used_ind)) & !is.na(thefeature4))
Low_feature_events4 = (scrub(thefeature4) <= quantile(thefeature4[!is.na(thefeature4)],as.numeric(quantile_used_ind)) & !is.na(thefeature4))
}
if (characteristic_irats5 != "None"){
thesign = ifelse(characteristic_irats5_sign, -1, +1)
thefeature5 = (thesign==-1) + thesign*DATASET_NEW$BUYBACK_DATA_TOOL[[which(names(DATASET_NEW$BUYBACK_DATA_TOOL) == characteristic_irats5)]]
High_feature_events5 = (scrub(thefeature5) >= quantile(thefeature5[!is.na(thefeature5)],1-as.numeric(quantile_used_ind)) & !is.na(thefeature5))
Low_feature_events5 = (scrub(thefeature5) <= quantile(thefeature5[!is.na(thefeature5)],as.numeric(quantile_used_ind)) & !is.na(thefeature5))
}
if (characteristic_irats6 != "None"){
thesign = ifelse(characteristic_irats6_sign, -1, +1)
thefeature6 = (thesign==-1) + thesign*DATASET_NEW$BUYBACK_DATA_TOOL[[which(names(DATASET_NEW$BUYBACK_DATA_TOOL) == characteristic_irats6)]]
High_feature_events6 = (scrub(thefeature5) >= quantile(thefeature5[!is.na(thefeature5)],1-as.numeric(quantile_used_ind)) & !is.na(thefeature5))
Low_feature_events6 = (scrub(thefeature5) <= quantile(thefeature5[!is.na(thefeature5)],as.numeric(quantile_used_ind)) & !is.na(thefeature5))
}
Index_score =
2*High_feature_events1 + 1*(!High_feature_events1 & !Low_feature_events1) +
(characteristic_irats2 != "None")*(2*High_feature_events2 + 1*(!High_feature_events2 & !Low_feature_events2) ) +
(characteristic_irats3 != "None")*(2*High_feature_events3 + 1*(!High_feature_events3 & !Low_feature_events3) ) +
(characteristic_irats4 != "None")*(2*High_feature_events4 + 1*(!High_feature_events4 & !Low_feature_events4) ) +
(characteristic_irats5 != "None")*(2*High_feature_events5 + 1*(!High_feature_events5 & !Low_feature_events5) ) +
(characteristic_irats6 != "None")*(2*High_feature_events6 + 1*(!High_feature_events6 & !Low_feature_events6) )
Index_Score_rect = Index_score
###
thefeature = Index_Score_rect
High_feature_events = (scrub(thefeature) >= quantile(thefeature[!is.na(thefeature)],1-as.numeric(quantile_used_all)) & !is.na(thefeature))
Low_feature_events = (scrub(thefeature) <= quantile(thefeature[!is.na(thefeature)],as.numeric(quantile_used_all)) & !is.na(thefeature))
res = round(cbind(
car_table(DATASET_NEW$returns_by_event_monthly[, Low_feature_events],
DATASET_NEW$BUYBACK_DATA_TOOL$Event.Date[ Low_feature_events],Risk_Factors_Monthly,formula_used = five_factor_model)$results,
car_table(DATASET_NEW$returns_by_event_monthly[, High_feature_events],
DATASET_NEW$BUYBACK_DATA_TOOL$Event.Date[High_feature_events],Risk_Factors_Monthly,formula_used = five_factor_model)$results
),2)[reported_times,]
colnames(res) <- c("Low: CAR", "t-stat","p-value", "High: CAR", "t-stat","p-value")
feature_IRATStable_index = res
###
thefeature = Index_Score_rect
High_feature_events = (scrub(thefeature) >= quantile(thefeature[!is.na(thefeature)],1-as.numeric(quantile_used_all)) & !is.na(thefeature))
Low_feature_events = (scrub(thefeature) <= quantile(thefeature[!is.na(thefeature)],as.numeric(quantile_used_all)) & !is.na(thefeature))
res = round(cbind(
calendar_table(DATASET_NEW$returns_by_event_monthly[, Low_feature_events],
DATASET_NEW$BUYBACK_DATA_TOOL$Event.Date[Low_feature_events],Risk_Factors_Monthly,formula_used = five_factor_model, value.weights = DATASET_NEW$value.weights[Low_feature_events])$results,
calendar_table(DATASET_NEW$returns_by_event_monthly[,High_feature_events],
DATASET_NEW$BUYBACK_DATA_TOOL$Event.Date[High_feature_events],Risk_Factors_Monthly,formula_used = five_factor_model, value.weights = DATASET_NEW$value.weights[High_feature_events])$results
),2)[reported_times,]
colnames(res) <- c("Low: CAL", "t-stat","p-value", "High: CAL", "t-stat","p-value")
feature_CALtable_index = res
###
thefeature = Index_Score_rect
High_feature_events = which(scrub(thefeature) >= quantile(thefeature[!is.na(thefeature)],1-as.numeric(quantile_used_all)) & !is.na(thefeature))
High_feature <- apply(PNL_matrix_BB(start_date_event,"One.Year.After", High_feature_events, DATASET_NEW$DatesMonth, DATASET_NEW$returns_by_event_monthly,event=1),1,non_zero_mean)
High_feature_Hedged_react_index = remove_initialization_time(suppressWarnings(scrub(alpha_lm(High_feature,Risk_Factors_Monthly[,pnl_hedge_factors],hedge_months,trade=1))),min_date=FirstTrade)
###
thefeature = Index_Score_rect
Low_feature_events = which(scrub(thefeature) <= quantile(thefeature[!is.na(thefeature)],as.numeric(quantile_used_all)) & !is.na(thefeature))
Low_feature <- apply(PNL_matrix_BB(start_date_event,"One.Year.After", Low_feature_events, DATASET_NEW$DatesMonth, DATASET_NEW$returns_by_event_monthly,event=1),1,non_zero_mean)
Low_feature_Hedged_react_index = remove_initialization_time(suppressWarnings(scrub(alpha_lm(Low_feature,Risk_Factors_Monthly[,pnl_hedge_factors],hedge_months,trade=1))),min_date=FirstTrade)
@
\clearpage
\begin{figure}[H]
\centering
<< fig.width=10, fig.height=5, out.width='\\textwidth', echo=F >>=
#par(mfrow=c(2,1), mar=c(2.3,4,2.3,4))
#valuation_index_bb[which(valuation_index_bb==2)]<-3 # there is one company here. need to check why
tmp = table(Index_Score_rect)
tmp = structure(as.numeric(tmp), .Names = names(tmp))
barplot(tmp,main = "", ylab = "Number of Events", xlab = "",las=2,space=0.5, cex.names=1)
#tmp = table(valuation_index_iss)
#tmp = structure(as.numeric(tmp), .Names = names(tmp))
#barplot(tmp,main = "SEOs", ylab = "Number of Announcements", xlab = "SEO Overvaluation Index",las=2,space=0.5, cex.names=1)
rm("tmp")
@
\caption{Distribution of the Customized Undervaluation Index of all buyback events.}
\label{fig:undervaluationindex}
\end{figure}
\clearpage
<< eval = TRUE, echo=FALSE,message=FALSE,fig.pos='h',results='asis' >>=
tmp = cbind(feature_IRATStable_index, feature_CALtable_index)[reported_times,]
colnames(tmp)[1]<-colnames(tmp)[4] <- "CAR"
printLatexTable(
tmp,
columns = c("IRATS CAR: LOW","HIGH","Calendar Time AR: LOW","HIGH"),
title= "Buyback IRATS and Calendar Time Abnormals Returns for the Customized Undervaluation Index",
caption= "The tables presents the abnormal returns for firms after repurchase announcements from the announcement date until $t$ months after the announcement. Left tables report monthly cumulative average abnormal returns (CAR) in percent using Ibbotson (1975) returns across time and security (IRATS) method combined with the Fama French (2015) five-factor model for the low and high prcentile sample of firms using the customized undervaluation index that announced an open market share repurchase. The following regressions are run each event month~$j$:
\\begin{eqnarray*}
(R_{i,t} - R_{f,t}) &=& a_j + b_j (R_{m,t} - R_{f,t}) + c_j {SMB}_t + d_j {HML}_t + \\epsilon_{i,t}, \\\\
(R_{i,t} - R_{f,t}) &=& a_j + b_j (R_{m,t} - R_{f,t}) + c_j {SMB}_t + d_j {HML}_t + e_t {RMW}_t + f_t {CMA}_t + \\epsilon_{i,t},
\\end{eqnarray*}
where $R_{i,t}$ is the monthly return on security $i$ in the calendar month $t$ that corresponds to the event month $j$, with $j = 0$ being the month of the repurchase announcement. $R_{f,t}$ and $R_{m,t}$ are the risk-free rate and the return on the equally weighted CRSP index, respectively. ${SMB}_t$, ${HML_t}$, ${RMW}_t$, ${CMA}_t$ are the monthly returns on the size, book-to-market factor, profitability factor and investment factor in month $t$, respectively. The numbers reported are sums of the intercepts of cross-sectional regressions over the relevant event-time-periods expressed in percentage terms. The standard error (denominator of the $t$-statistic) for a window is the square root of the sum of the squares of the monthly standard errors. Right tables report monthly average abnormal returns (AR) of equally weighted Calendar Time portfolios using the Fama and French (2015a) five-factor model. In this method, event firms that have announced an open market buyback in the last calendar months form the basis of the calendar month portfolio. A single time-series regression is run with the excess returns of the calendar portfolio as the dependent variable and the returns of five factors as the independent variables. The significance levels are indicated by +, *, and ** and correspond to a significance level of $10\\%$, $5\\%$, and $1\\%$ respectively, using a two-tailed test.
",
label = "tbl:CUcharacteristic",
titleontop=T,
metric = "Ret.",
scale=1,
lastSpecial=T#,
#dorotate=F
)
@
\clearpage
\begin{figure}[H]
\centering
<< BBISSpnl2, fig.width=10, fig.height=7, out.width='\\textwidth', echo=F >>=
plot(cumsum(100*Low_feature_Hedged_react_index),type="l",ylab="CAR", xlab = "",main = "Excess Returns of a Buyback Strategy based on the Customized Undervaluation Index", axes = FALSE, ylim=c(min(c(100*cumsum(Low_feature_Hedged_react_index),cumsum(100*High_feature_Hedged_react_index))), max(c(cumsum(100*Low_feature_Hedged_react_index),cumsum(100*High_feature_Hedged_react_index)))), cex.lab=1.1)
axis(1,at=seq(1,length(Low_feature_Hedged_react_index),length.out=10),labels=str_sub(names(Low_feature_Hedged_react_index)[seq(1,length(Low_feature_Hedged_react_index),length.out=10)], start = 1, end=4),cex.axis=1,las=3)
axis(2,cex.axis=1.1)
lines(cumsum(100*High_feature_Hedged_react_index), lty = 2,lwd=1.4)
for (iter in floor(100*min(c(cumsum(Low_feature_Hedged_react),cumsum(High_feature_Hedged_react_index)))/100):floor(100*max(c(cumsum(Low_feature_Hedged_react_index),cumsum(High_feature_Hedged_react_index)))/100))
abline(h = 100*iter)
#plot_crisis_dates(Low_feature_Hedged_react)
legend(x="topleft",
c("High Cusomized U-Index","Low Cusomized U-Index"),
lty=c("solid","dashed"),
lwd=c(2,2),
cex=1,bg="white",inset=0.01)
@
\caption{Buybacks: Returns of five-factor rolling hedged portfolio for only the buyback events for high and low percentile events defined using the Customized Undervaluation Index. Solid line is ``high'' and a 12-months holding portfolio, dotted line is ``low'' and a 12-months holding portfolio.
}
\label{fig:CUcharacteristic}
\end{figure}
\clearpage
<< eval = TRUE, echo=FALSE,message=FALSE,fig.pos='h',results='asis' >>=
latex_render_data_frame(
pnl_matrix(remove_initialization_time(High_feature_Hedged_react_index,min_date=FirstTrade)),
title = "Monthly and Yearly Five Factor Abnormal Rerurns of a strategy investing in the high percentile buybacks defined using the Customized Undervaluation Index",
caption="Monthly and yearly five-factor rolling hedged abnormal returns of an equally weighted (with monthly rebalancing) portfolio of selected buybacks. The holding period for each buyback is 12 months per event.",
label="tbl:CUcharacteristicpnl",
columns=NULL,
bigtitleontop = T,
show_rownames=TRUE,
scale = 0.9,
digits=1,
lastSpecial=F#,dorotate=F
)
@
\clearpage
\end{document}