|
| 1 | +# Copyright 2015, INSEAD |
| 2 | +# by T. Evgeniou, Enric Junque de Fortuny, Nick Nassuphis, Theo Vermaelen |
| 3 | +# Dual licensed under the MIT or GPL Version 2 licenses. |
| 4 | + |
| 5 | + |
| 6 | +########################################################################################## |
| 7 | +# Creates a small subset of the data only used for the interactive tool - to load faster |
| 8 | +########################################################################################## |
| 9 | + |
| 10 | +rm(list=ls()) # Clean up the memory, if we want to rerun from scratch |
| 11 | +load("bb_issuers_new.Rdata") |
| 12 | + |
| 13 | +BUYBACK_DATA_TOOL = data.frame( |
| 14 | + |
| 15 | + Prior.Returns.Score = BUYBACK_DATA$DATASET$CRSP$recent_performance_score, |
| 16 | + BE.ME.Score = BUYBACK_DATA$DATASET$CRSP$BE.ME_score, |
| 17 | + Size.Score = BUYBACK_DATA$DATASET$CRSP$Market.Cap_score, |
| 18 | + Valuation.Index = BUYBACK_DATA$Valuation_Index, |
| 19 | + EU.Index = sapply(1:length(BUYBACK_DATA$DATASET$SDC$Event.Date), function(i){ |
| 20 | + ifelse(High_Idiosyncr_eventsBB[i], 2, ifelse(Low_Idiosyncr_eventsBB[i], 0, 1)) + |
| 21 | + ifelse(High_VOL_eventsBB[i], 2, ifelse(Low_VOL_eventsBB[i], 0, 1)) + |
| 22 | + ifelse(company_subset_undervalued_bb[i], 2, ifelse(company_subset_overvalued_bb[i], 0, 1)) |
| 23 | + }), |
| 24 | + Market.Cap = BUYBACK_DATA$DATASET$CRSP$Market.Cap, |
| 25 | + Percent.Shares = BUYBACK_DATA$DATASET$SDC$Event.Size, |
| 26 | + Market.beta.Score = BUYBACK_DATA$DATASET$CRSP$Market.Cap_score, |
| 27 | + one.minus.Rsq.Score = 1-BUYBACK_DATA$DATASET$CRSP$Rsq_score, |
| 28 | + pre.vol.Score = BUYBACK_DATA$DATASET$CRSP$pre_vol_Score, |
| 29 | + ivol.Score = BUYBACK_DATA$DATASET$CRSP$IVOL_score, |
| 30 | + leverage.ratio = BUYBACK_DATA$DATASET$CRSP$leverage_lt_over_lt_plus_e, |
| 31 | + Event.Date = BUYBACK_DATA$DATASET$SDC$Event.Date, |
| 32 | + Event.Size = BUYBACK_DATA$DATASET$SDC$Event.Size, |
| 33 | + Industry_name = BUYBACK_DATA$DATASET$SDC$Industry_name |
| 34 | + |
| 35 | +) |
| 36 | +Risk_Factors_Monthly <- BUYBACK_DATA$Risk_Factors_Monthly |
| 37 | +returns_by_event_monthly <- BUYBACK_DATA$DATASET$returns_by_event_monthly |
| 38 | +DatesMonth = BUYBACK_DATA$DATASET$DatesMonth |
| 39 | + |
| 40 | +save(BUYBACK_DATA_TOOL,Risk_Factors_Monthly,returns_by_event_monthly,DatesMonth, file = "bb_issuersTOOL.Rdata") |
| 41 | + |
| 42 | + |
0 commit comments