library(tidyverse)
library(knitr)
library(kableExtra)
library(lubridate)
library(bizdays)
library(zoo)

Overview

This project replicates the famous cyclical pattern of equity returns reported by Adair, Morse and Vissing-Jorgensen in their paper “Stocks Over the FOMC Cycle”. It does not replicate the statistical regression results they document, but it does replicate the pattern of cyclical returns of weekly returns vs. FOMC cycle dates. They argue that the equity premium since 1994 has been entirely earned in weeks 0, 2, 4, and 6 of the FOMC cycle time, in even weeks starting from the last FOMC meeting.

Create Calendar for US Federal Holidays

We will need to calculate the number of business days around each FOMC meeting. Thus, a holiday calendar is essential to perform these calculations. The bizdays library is used to perform this.

# Load the US Holidays from a CSV file which I manually cleansed
# by comparing US holidays in timeanddate.com to a dataset in Kaggle.com
# which had errors.
#-----------------------------------------------------------------
us_holidays = read_csv("usholidays_cleansed.csv")
us_holidays %>% mutate( holiday = mdy(Date)) -> us_holidays
str(us_holidays)
## Classes 'spec_tbl_df', 'tbl_df', 'tbl' and 'data.frame': 484 obs. of  4 variables:
##  $ Index  : num  1 2 3 4 5 6 7 8 9 10 ...
##  $ Date   : chr  "1/1/1966" "2/22/1966" "7/4/1966" "9/5/1966" ...
##  $ Holiday: chr  "New Year’s Day" "Washington’s Birthday" "Independence Day" "Labor Day" ...
##  $ holiday: Date, format: "1966-01-01" "1966-02-22" ...
#
# Define the US observed federal holidays calendar from 1966-2020
# ---------------------------------------------------------------
mycal = create.calendar(name='MyCalendar', holidays=us_holidays$holiday, weekdays=c('sunday','saturday') , adjust.from = adjust.next , adjust.to=adjust.previous)

Identify the FOMC cycle time of each date

There are 8 FOMC meetings in a typical year. For each FOMC date, we need to find all business dates within a period before and after that date.

An FOMC date is defined as the last of 2 meeting dates when the FOMC meets to discuss and announce the target policy federal funds rate. At 2:00 or 2:15pm ET on the FOMC date, the statement is released to the public. Financial market practitioners are waiting to hear the outcomes.

For FOMC cycle purposes, the FOMC date is labelled as day 0 in its cycle.

Day 1 is the first business day after the FOMC date. Day 2 is the second business day afterwards and so forth. Likewise, day -1 is the first business date before the FOMC date.

We display the list of boundaries defining the weeks of an FOMC cycle expressed in business day offsets from the FOMC date. Each week below includes both its boundary dates.

weekDef = data.frame( weekNum = c(-1, 0, 1, 2, 3, 4, 5, 6) ,
                 start = c( -6, -1, 4, 9, 14, 19, 24, 29) ,
                 end = c( -2, 3, 8, 13, 18, 23, 28, 33)
                 )

weekDef %>% kable() %>% kable_styling() 
weekNum start end
-1 -6 -2
0 -1 3
1 4 8
2 9 13
3 14 18
4 19 23
5 24 28
6 29 33
fomc_dates = read_csv("fomc_dates_1994_2019.csv")

fomc_dates %>% mutate( mdyDate = mdy(Date)) -> fomc_dates

Load the Equity Total Return Index

Use the Russell 1000 priced dates as the total set of business days and convert them to date objects. Note that we need prices for FOMC dates from 1994-02-04 to 2019-03-20. Based on this constraint of FOMC dates, we will chose equity prices from a date range relevant to the FOMC cycle calculations of this dates. This requires equity prices in a range from Jan 27, 1994 to May 10, 2019. The basis for this date range will be fully explored later when discussing FOMC cycle time.

#
#  Reads the Russell 1000 Date and Index Level.
# -----------------------------------------------------------------------
raw_russell = read_csv("RU1000TR.csv", col_types = cols( RU1000TR = col_double() ) )

# Convert the raw date column into a Date object and filter on the relevant range + a slight extra days in Jan 1994.
# ------------------------------------------------------------------------------------------------------------------
raw_russell %>% mutate( mdyDate = mdy(DATE)) %>%
           filter( (mdyDate >= "1994-01-04") & (mdyDate <= "2019-05-10") ) -> russ
ggplot(data=russ) + geom_point( aes(x = mdyDate , y = russ$RU1000TR) ) + ggtitle("Russell 1000 Index", subtitle="Prices from 1994-2019")

## Load the Treasury-Bill Yields

To calculate the excess return of equities over the risk free rate, we also need to obtain a proxy for the risk free rate. The best proxy that I found was the US Treasury Bill 3 month rate. The requirements are to have daily data from 1994 to 2019.
Other time series like the 1 month US Treasury Bill rate do not have adequate time series history.

In the code below, I download the 3 month T-Bill rate from the Federal Reserve’s H15 Report of interest rate data. Next, I parse the file, skipping header rows and extracting the relevant two columns: the date and rate.

There are several challenges which we overcome: + Header section occupies the first 5 rows + file contains 3m month rates in the third column + missing values occur on federal holidays with a placeholder string “ND” + column names are inappropriate + column datatypes need to be transformed into dates and doubles for dates and rates respectively.

#But these transformations are incomplete because holidays are displayed in the file showing a rate value "ND" for the holiday date row.  These #need to be removed in order for the rate data to be suitably convertible to a numerical type.

FRB_H15_data = read_csv("FRB_H15.csv", skip=5) %>% 
  select( c(1, 3))  %>% 
  rename( date = `Time Period`, rate = `RIFLGFCM03_N.B`) %>% 
  filter( !(rate=="ND")) %>%
  mutate( rate = as.double(rate)) -> tbill3m

Joining Equity Prices with T-Bill Rates is necessary to calculate the excess return for each observation.

russ %>% left_join( tbill3m, by = c( "mdyDate" = "date") ) -> eq_data

#  Replace missing T-Bill rates with the prior day's non-missing T-Bill rate 
# ---------------------------------------------------------------------------
eq_data$rate = na.locf(eq_data$rate)  # zoo library provided a known function

Calculate the Equity Premium

Our observations of the equity premium will range from Feb 2, 1994 to May 6, 2019. However, since the equity premium is calculated according over a 5-day window spanning the business day prior to the observation date to 4 days after, we need equity and yield date from Jan 27, 1994 to May 10, 2019. Later this data will be truncated to avoid windowing effects, but that will not impact statistical significance.

The equity premium \(h(t)\) is defined as for observation date \(t\) as:

\[h(t) = \left[ \frac{S(c(t,4))}{S(c(t,-1))} -1 \right] - \frac{c(t,4)-c(t,-1)}{30}\times (\frac{Y(t)}{100} \frac{91}{365})\]

Here \(c(t,d)\) represents the business date which is d days offset from date \(t\). Hence \(c(t,4)\) is 4 business days after \(t\). Also, \(Y(t)\) defines the 3-month Treasury bill rate expressed as percent in the raw file. Lastly, \(S(t)\) represents the equity index level on date \(t\).

We illustrate the first 100 rows in the table below.

# Use a recipe to conditionally mutate a row within the interior of the time period in the dataframe.
#---------------------------------------------------------------------------------------------------------

eq_data %>% mutate( equity_lead = lead(RU1000TR, 4, default=NA),
                      equity_lag = lag(RU1000TR, 1, default=NA) ,
                      days_lag    = lag(mdyDate, 1),  
                      days_lead   = lead(mdyDate, 4 ) ,
                      days_diff = as.numeric(days_lead - days_lag, units="days") ,
                      excess_ret = (equity_lead/ equity_lag - 1.0) - 0.01 * (days_diff)/30 * (rate/100) *(91/365)
                      ) -> eq_data
str(eq_data)
## Classes 'spec_tbl_df', 'tbl_df', 'tbl' and 'data.frame': 6398 obs. of  10 variables:
##  $ DATE       : chr  "1/4/1994" "1/5/1994" "1/6/1994" "1/7/1994" ...
##  $ RU1000TR   : num  883 884 883 888 897 ...
##  $ mdyDate    : Date, format: "1994-01-04" "1994-01-05" ...
##  $ rate       : num  3.15 3.14 3.12 3.07 3.06 3.04 3.02 3.01 3.03 3.03 ...
##  $ equity_lead: num  897 896 896 894 898 ...
##  $ equity_lag : num  NA 883 884 883 888 ...
##  $ days_lag   : Date, format: NA "1994-01-04" ...
##  $ days_lead  : Date, format: "1994-01-10" "1994-01-11" ...
##  $ days_diff  : num  NA 7 7 7 7 7 7 7 7 7 ...
##  $ excess_ret : num  NA 0.0146 0.0129 0.012 0.0111 ...
eq_data[1:100,] %>% kable() %>% kable_styling() %>% scroll_box(height = "400px", width="100%")
DATE RU1000TR mdyDate rate equity_lead equity_lag days_lag days_lead days_diff excess_ret
1/4/1994 882.96 1994-01-04 3.15 897.33 NA NA 1994-01-10 NA NA
1/5/1994 884.48 1994-01-05 3.14 895.85 882.96 1994-01-04 1994-01-11 7 0.0145804
1/6/1994 883.42 1994-01-06 3.12 895.89 884.48 1994-01-05 1994-01-12 7 0.0128821
1/7/1994 888.33 1994-01-07 3.07 894.08 883.42 1994-01-06 1994-01-13 7 0.0120489
1/10/1994 897.33 1994-01-10 3.06 898.24 888.33 1994-01-07 1994-01-14 7 0.0111380
1/11/1994 895.85 1994-01-11 3.04 895.57 897.33 1994-01-10 1994-01-17 7 -0.0019791
1/12/1994 895.89 1994-01-12 3.02 896.71 895.85 1994-01-11 1994-01-18 7 0.0009424
1/13/1994 894.08 1994-01-13 3.01 895.82 895.89 1994-01-12 1994-01-19 7 -0.0000956
1/14/1994 898.24 1994-01-14 3.03 897.52 894.08 1994-01-13 1994-01-20 7 0.0038299
1/17/1994 895.57 1994-01-17 3.03 896.55 898.24 1994-01-14 1994-01-21 7 -0.0018991
1/18/1994 896.71 1994-01-18 3.04 892.43 895.57 1994-01-17 1994-01-24 7 -0.0035238
1/19/1994 895.82 1994-01-19 3.03 890.33 896.71 1994-01-18 1994-01-25 7 -0.0071325
1/20/1994 897.52 1994-01-20 3.01 894.42 895.82 1994-01-19 1994-01-26 7 -0.0015803
1/21/1994 896.55 1994-01-21 3.01 902.49 897.52 1994-01-20 1994-01-27 7 0.0055200
1/24/1994 892.43 1994-01-24 3.01 906.15 896.55 1994-01-21 1994-01-28 7 0.0106902
1/25/1994 890.33 1994-01-25 2.99 911.37 892.43 1994-01-24 1994-01-31 7 0.0212056
1/26/1994 894.42 1994-01-26 2.98 908.40 890.33 1994-01-25 1994-02-01 7 0.0202785
1/27/1994 902.49 1994-01-27 2.98 912.56 894.42 1994-01-26 1994-02-02 7 0.0202640
1/28/1994 906.15 1994-01-28 2.99 910.00 902.49 1994-01-27 1994-02-03 7 0.0083040
1/31/1994 911.37 1994-01-31 3.05 889.22 906.15 1994-01-28 1994-02-04 7 -0.0187012
2/1/1994 908.40 1994-02-01 3.10 892.97 911.37 1994-01-31 1994-02-07 7 -0.0202074
2/2/1994 912.56 1994-02-02 3.13 892.71 908.40 1994-02-01 1994-02-08 7 -0.0172903
2/3/1994 910.00 1994-02-03 3.20 896.38 912.56 1994-02-02 1994-02-09 7 -0.0177490
2/4/1994 889.22 1994-02-04 3.30 889.80 910.00 1994-02-03 1994-02-10 7 -0.0222170
2/7/1994 892.97 1994-02-07 3.31 891.05 889.22 1994-02-04 1994-02-11 7 0.0020387
2/8/1994 892.71 1994-02-08 3.32 891.92 892.97 1994-02-07 1994-02-14 7 -0.0011952
2/9/1994 896.38 1994-02-09 3.32 896.48 892.71 1994-02-08 1994-02-15 7 0.0042038
2/10/1994 889.80 1994-02-10 3.33 896.26 896.38 1994-02-09 1994-02-16 7 -0.0001532
2/11/1994 891.05 1994-02-11 3.33 891.78 889.80 1994-02-10 1994-02-17 7 0.0022058
2/14/1994 891.92 1994-02-14 3.34 887.28 891.05 1994-02-11 1994-02-18 7 -0.0042504
2/15/1994 896.48 1994-02-15 3.34 893.75 891.92 1994-02-14 1994-02-22 8 0.0020295
2/16/1994 896.26 1994-02-16 3.34 892.28 896.48 1994-02-15 1994-02-23 8 -0.0047072
2/17/1994 891.78 1994-02-17 3.35 881.13 896.26 1994-02-16 1994-02-24 8 -0.0169035
2/18/1994 887.28 1994-02-18 3.36 884.56 891.78 1994-02-17 1994-02-25 8 -0.0081185
2/22/1994 893.75 1994-02-22 3.40 887.43 887.28 1994-02-18 1994-02-28 10 0.0001408
2/23/1994 892.28 1994-02-23 3.46 882.95 893.75 1994-02-22 1994-03-01 7 -0.0121040
2/24/1994 881.13 1994-02-24 3.44 883.52 892.28 1994-02-23 1994-03-02 7 -0.0098376
2/25/1994 884.56 1994-02-25 3.44 880.88 881.13 1994-02-24 1994-03-03 7 -0.0003037
2/28/1994 887.43 1994-02-28 3.47 884.66 884.56 1994-02-25 1994-03-04 7 0.0000929
3/1/1994 882.95 1994-03-01 3.58 889.45 887.43 1994-02-28 1994-03-07 7 0.0022554
3/2/1994 883.52 1994-03-02 3.55 887.17 882.95 1994-03-01 1994-03-08 7 0.0047588
3/3/1994 880.88 1994-03-03 3.56 888.90 883.52 1994-03-02 1994-03-09 7 0.0060686
3/4/1994 884.66 1994-03-04 3.62 882.97 880.88 1994-03-03 1994-03-10 7 0.0023516
3/7/1994 889.45 1994-03-07 3.61 887.51 884.66 1994-03-04 1994-03-11 7 0.0032006
3/8/1994 887.17 1994-03-08 3.63 890.10 889.45 1994-03-07 1994-03-14 7 0.0007097
3/9/1994 888.90 1994-03-09 3.61 890.18 887.17 1994-03-08 1994-03-15 7 0.0033718
3/10/1994 882.97 1994-03-10 3.57 895.18 888.90 1994-03-09 1994-03-16 7 0.0070441
3/11/1994 887.51 1994-03-11 3.58 897.96 882.97 1994-03-10 1994-03-17 7 0.0169560
3/14/1994 890.10 1994-03-14 3.66 898.09 887.51 1994-03-11 1994-03-18 7 0.0118997
3/15/1994 890.18 1994-03-15 3.66 893.90 890.10 1994-03-14 1994-03-21 7 0.0042479
3/16/1994 895.18 1994-03-16 3.61 893.86 890.18 1994-03-15 1994-03-22 7 0.0041130
3/17/1994 897.96 1994-03-17 3.55 893.82 895.18 1994-03-16 1994-03-23 7 -0.0015399
3/18/1994 898.09 1994-03-18 3.57 885.36 897.96 1994-03-17 1994-03-24 7 -0.0140526
3/21/1994 893.90 1994-03-21 3.70 879.22 898.09 1994-03-18 1994-03-25 7 -0.0210328
3/22/1994 893.86 1994-03-22 3.60 877.13 893.90 1994-03-21 1994-03-28 7 -0.0187814
3/23/1994 893.82 1994-03-23 3.54 862.24 893.86 1994-03-22 1994-03-29 7 -0.0353953
3/24/1994 885.36 1994-03-24 3.53 849.59 893.82 1994-03-23 1994-03-30 7 -0.0495048
3/25/1994 879.22 1994-03-25 3.57 849.51 885.36 1994-03-24 1994-03-31 7 -0.0405128
3/28/1994 877.13 1994-03-28 3.57 836.72 879.22 1994-03-25 1994-04-04 10 -0.0483680
3/29/1994 862.24 1994-03-29 3.59 855.60 877.13 1994-03-28 1994-04-05 8 -0.0245698
3/30/1994 849.59 1994-03-30 3.57 855.58 862.24 1994-03-29 1994-04-06 8 -0.0077478
3/31/1994 849.51 1994-03-31 3.56 860.68 849.59 1994-03-30 1994-04-07 8 0.0130297
4/4/1994 836.72 1994-04-04 3.82 853.47 849.51 1994-03-31 1994-04-08 8 0.0046361
4/5/1994 855.60 1994-04-05 3.75 857.14 836.72 1994-04-04 1994-04-11 7 0.0243830
4/6/1994 855.58 1994-04-06 3.67 853.08 855.60 1994-04-05 1994-04-12 7 -0.0029667
4/7/1994 860.68 1994-04-07 3.61 849.39 855.58 1994-04-06 1994-04-13 7 -0.0072559
4/8/1994 853.47 1994-04-08 3.65 849.92 860.68 1994-04-07 1994-04-14 7 -0.0125230
4/11/1994 857.14 1994-04-11 3.68 850.28 853.47 1994-04-08 1994-04-15 7 -0.0037591
4/12/1994 853.08 1994-04-12 3.64 843.55 857.14 1994-04-11 1994-04-18 7 -0.0158762
4/13/1994 849.39 1994-04-13 3.64 843.14 853.08 1994-04-12 1994-04-19 7 -0.0116731
4/14/1994 849.92 1994-04-14 3.66 841.47 849.39 1994-04-13 1994-04-20 7 -0.0093456
4/15/1994 850.28 1994-04-15 3.68 854.24 849.92 1994-04-14 1994-04-21 7 0.0050614
4/18/1994 843.55 1994-04-18 3.84 852.96 850.28 1994-04-15 1994-04-22 7 0.0031296
4/19/1994 843.14 1994-04-19 3.83 861.74 843.55 1994-04-18 1994-04-25 7 0.0215413
4/20/1994 841.47 1994-04-20 3.83 861.15 843.14 1994-04-19 1994-04-26 7 0.0213383
4/21/1994 854.24 1994-04-21 3.83 861.15 841.47 1994-04-20 1994-04-27 7 0.0233654
4/22/1994 852.96 1994-04-22 3.84 855.42 854.24 1994-04-21 1994-04-28 7 0.0013590
4/25/1994 861.74 1994-04-25 3.94 859.71 852.96 1994-04-22 1994-04-29 7 0.0078907
4/26/1994 861.15 1994-04-26 3.97 864.72 861.74 1994-04-25 1994-05-02 7 0.0034350
4/27/1994 861.15 1994-04-27 3.97 864.47 861.15 1994-04-26 1994-05-03 7 0.0038322
4/28/1994 855.42 1994-04-28 3.98 863.02 861.15 1994-04-27 1994-05-04 7 0.0021484
4/29/1994 859.71 1994-04-29 3.97 862.03 855.42 1994-04-28 1994-05-05 7 0.0077041
5/2/1994 864.72 1994-05-02 4.10 854.34 859.71 1994-04-29 1994-05-06 7 -0.0062701
5/3/1994 864.47 1994-05-03 4.12 843.64 864.72 1994-05-02 1994-05-09 7 -0.0244018
5/4/1994 863.02 1994-05-04 4.15 849.89 864.47 1994-05-03 1994-05-10 7 -0.0168900
5/5/1994 862.03 1994-05-05 4.13 840.97 863.02 1994-05-04 1994-05-11 7 -0.0255738
5/6/1994 854.34 1994-05-06 4.30 844.52 862.03 1994-05-05 1994-05-12 7 -0.0203375
5/9/1994 843.64 1994-05-09 4.44 845.65 854.34 1994-05-06 1994-05-13 7 -0.0101974
5/10/1994 849.89 1994-05-10 4.35 845.48 843.64 1994-05-09 1994-05-16 7 0.0021557
5/11/1994 840.97 1994-05-11 4.32 854.20 849.89 1994-05-10 1994-05-17 7 0.0050461
5/12/1994 844.52 1994-05-12 4.24 864.10 840.97 1994-05-11 1994-05-18 7 0.0274793
5/13/1994 845.65 1994-05-13 4.24 869.26 844.52 1994-05-12 1994-05-19 7 0.0292701
5/16/1994 845.48 1994-05-16 4.31 866.91 845.65 1994-05-13 1994-05-20 7 0.0251154
5/17/1994 854.20 1994-05-17 4.30 863.82 845.48 1994-05-16 1994-05-23 7 0.0216668
5/18/1994 864.10 1994-05-18 4.29 867.66 854.20 1994-05-17 1994-05-24 7 0.0157325
5/19/1994 869.26 1994-05-19 4.24 870.58 864.10 1994-05-18 1994-05-25 7 0.0074745
5/20/1994 866.91 1994-05-20 4.26 872.08 869.26 1994-05-19 1994-05-26 7 0.0032194
5/23/1994 863.82 1994-05-23 4.35 872.62 866.91 1994-05-20 1994-05-27 7 0.0065613
5/24/1994 867.66 1994-05-24 4.32 871.13 863.82 1994-05-23 1994-05-31 8 0.0084337
5/25/1994 870.58 1994-05-25 4.28 874.04 867.66 1994-05-24 1994-06-01 8 0.0073247

Calculating FOMC Cycle Dates

N = length(eq_data$mdyDate)
M = length(fomc_dates$mdyDate)

# Store the FOMC Cycle information into the data frame.
# We store a lower FOMC date.  I.e. the greatest date less than trade date
#    upper FOMC date is the least FOMC date greater than trade date.
#    When no lower FOMC date exists because trade date is before first FOMC date, we set lowerIndex =0
#    When no upper FOMC date exists because trade date is after last FOMC date, we set upperIndex = M + 1
#
#    offsetL is the number of business days from the lower FOMC date to the trade date.  It is non-negative.
#
#    offsetU is the negative of number of business days from upper FOMC date to trade date. It is non-positive.
#
#    weekNum is a number from 0,1-6 for the number of 
# ----------------------------------------------------------------------------------------------------
cycle_data = data.frame( trade_date = eq_data$mdyDate, 
                         lowerIndex = rep(0,N),
                         upperIndex = rep(0,N),
                         lowerFOMC  = as.Date(integer(N)) ,
                         upperFOMC  = as.Date(integer(N)) ,
                         offsetL    = rep(0,N),
                         offsetU    = rep(0,N),
                         weekNum    = rep(0,N),
                         dum_w0     = rep(0,N),
                         dum_w2     = rep(0,N),
                         dum_w4     = rep(0,N),
                         dum_w6     = rep(0,N),
                         dum_w0246  = rep(0,N),
                         dum_w246   = rep(0,N)
                         )
# Located the lower FOMC date by a linear search algorithm that re-uses the prior matches'
# FOMC date location to find the correct FOMC date for the next trade date.
# Bootstrap:  Identify the lower FOMC date for the earliest trade dates by searching from
#             right to left backwards in time.
# --------------------------------------------------

lowerIndices = findInterval(as.integer(eq_data$mdyDate), as.integer(fomc_dates$mdyDate))

for(i in 1:N)
{
    if( lowerIndices[i]== 0 )
    {
         cycle_data$lowerFOMC[i] = as.Date( mdy("01-01-1970") )
    }
    else
    {
         cycle_data$lowerFOMC[i] = fomc_dates$mdyDate[lowerIndices[i]]
    }
}

cycle_data$lowerIndex = lowerIndices

# Populate the offsetL = the number of business days AFTER the lowerFOMC date
# This is used to calibrate the business cycle and ultimately the dummy variables
# in the regression analysis
# -----------------------------------------------------------------------------
for(i in 1:N)
{
     if( cycle_data$lowerIndex[i] == 0 )
     {
          cycle_data$offsetL[i] = NA
     }
     else
     {
          cycle_data$offsetL[i] = bizdays(cycle_data$lowerFOMC[i], cycle_data$trade_date[i], mycal)
     }
}

# Populate the upper FOMC date offset. This will be a negative number
# since it counts the number of days BEFORE the FOMC date.
# ----------------------------------------------------------------
for(i in 1:N)
{
    # If a trade date has no lower FOMC date 
    # then its first upper FOMC date must be the first one.
    #----------------------------------------
    if( cycle_data$lowerIndex[i] == 0 )
    {
        cycle_data$upperIndex[i] = 1  
    }
    else
    {
        if(cycle_data$lowerIndex[i] > 0 && fomc_dates$mdyDate[ cycle_data$lowerIndex[i] ] == eq_data$mdyDate[i] )
        {
            cycle_data$upperIndex[i] = cycle_data$lowerIndex[i]  # This is an FOMC date
        }
        else
        {
            # fomc_dates$mdyDate[ cycle_datalowerIndex[i] ] < eq_data$mdyData[i] 
        
            cycle_data$upperIndex[i] = cycle_data$lowerIndex[i] + 1
        }
    }
}
for(i in 1:N)
{
    if( cycle_data$upperIndex[i] <= M )
    {
        cycle_data$upperFOMC[i] = fomc_dates$mdyDate[ cycle_data$upperIndex[i] ]
    }
}

#
# Populate the negative FOMC cycle offsets
# -----------------------------------------------------------
for(i in 1:N)
{
     if( cycle_data$upperIndex[i] > M )
     {
          cycle_data$offsetU[i] = NA
     }
     else
     {
          cycle_data$offsetU[i] = -bizdays(cycle_data$trade_date[i],cycle_data$upperFOMC[i], mycal)
     }
}     

Finally, we have to classification on each trade date to belong to one of weeks 0,1,2..6. Except for day -1 of an FOMC cycle which is identified by a value of \(offsetU = -1\), all other days of an FOMC cycle are classified by the value of \(offsetL\) based on the earlier table defining the week ranges.

for(i in 1:N)
{
    if( !is.na(cycle_data$offsetU[i]) && cycle_data$offsetU[i] == -1)
    {
        cycle_data$weekNum[i] = 0
    }
    else
    {
        z = cycle_data$offsetL[i]
      
        if(is.na(z))
        {
            cycle_data$weekNum[i] = NA    
            next;
        }
        
        if( (z >= 0) && (z <= 3))
        {
            cycle_data$weekNum[i] = 0
        }
        if( z >= 4 && z <= 8)
        {
            cycle_data$weekNum[i] = 1
        }
        if( z >= 9 && z <= 13)
        {
            cycle_data$weekNum[i] = 2 
        }
        if(z >= 14 && z <= 18 )
        {
            cycle_data$weekNum[i] = 3
        }
        if(z >= 19 && z <= 23)
        {
            cycle_data$weekNum[i] = 4
        }
        if(z >= 24 && z <= 28)
        {
            cycle_data$weekNum[i] = 5
        }
        if(z >= 29 && z <= 33)
        {
            cycle_data$weekNum[i] = 6
        }
        if(z >= 34 && z <= 38)
        {
            cycle_data$weekNum[i] = 7
        }
        if(z >= 39 && z <= 43)
        {
            cycle_data$weekNum[i] = 8
        }
    }
}

for(i in 1:N)
{
    if( is.na(cycle_data$weekNum[i]) )
    {
        next;  
    }
    else
    {
        weekNum = cycle_data$weekNum[i]
        
        # default is false
        cycle_data$dum_w0[i] = 0
        cycle_data$dum_w0246[i] = 0
        cycle_data$dum_w2[i] = 0
        cycle_data$dum_w4[i] = 0
        cycle_data$dum_w6[i] = 0
        cycle_data$dum_w246[i] = 0
        
        if( weekNum == 0)
        {
            cycle_data$dum_w0[i] = 1
            cycle_data$dum_w0246[i] = 1
        }
        if( weekNum == 2)
        {
            cycle_data$dum_w2[i] = 1
            cycle_data$dum_w246[i] = 1
            cycle_data$dum_w0246[i] = 1
        }
        if( weekNum == 4 )
        {
            cycle_data$dum_w4[i] = 1
            cycle_data$dum_w246[i] = 1
            cycle_data$dum_w0246[i] = 1
        }
        if( weekNum == 6 )
        {
            cycle_data$dum_w6[i] = 1
            cycle_data$dum_w246[i] = 1
            cycle_data$dum_w0246[i] = 1
        }
    }
}

Finally we display the fully prepared FOMC cycle information. For each potential observation we have calculated the associated lower and upper FOMC dates surrounding the trade date. In turn, we have derived the business day offset both above. These offsets are required to calculate the correct week periods in the regression analysis. Before we do that, it is necessary to join together the equity premium data with the FOMC cycle data.

Below we display the 100 earlier and 100 latest observations of FOMC cycle data.

cycle_data[c(1:100,(N-100):N),] %>% kable() %>% kable_styling() %>% scroll_box(height="300px", width="100%")
trade_date lowerIndex upperIndex lowerFOMC upperFOMC offsetL offsetU weekNum dum_w0 dum_w2 dum_w4 dum_w6 dum_w0246 dum_w246
1 1994-01-04 0 1 1970-01-01 1994-02-04 NA -22 NA 0 0 0 0 0 0
2 1994-01-05 0 1 1970-01-01 1994-02-04 NA -21 NA 0 0 0 0 0 0
3 1994-01-06 0 1 1970-01-01 1994-02-04 NA -20 NA 0 0 0 0 0 0
4 1994-01-07 0 1 1970-01-01 1994-02-04 NA -19 NA 0 0 0 0 0 0
5 1994-01-10 0 1 1970-01-01 1994-02-04 NA -18 NA 0 0 0 0 0 0
6 1994-01-11 0 1 1970-01-01 1994-02-04 NA -17 NA 0 0 0 0 0 0
7 1994-01-12 0 1 1970-01-01 1994-02-04 NA -16 NA 0 0 0 0 0 0
8 1994-01-13 0 1 1970-01-01 1994-02-04 NA -15 NA 0 0 0 0 0 0
9 1994-01-14 0 1 1970-01-01 1994-02-04 NA -14 NA 0 0 0 0 0 0
10 1994-01-17 0 1 1970-01-01 1994-02-04 NA -13 NA 0 0 0 0 0 0
11 1994-01-18 0 1 1970-01-01 1994-02-04 NA -13 NA 0 0 0 0 0 0
12 1994-01-19 0 1 1970-01-01 1994-02-04 NA -12 NA 0 0 0 0 0 0
13 1994-01-20 0 1 1970-01-01 1994-02-04 NA -11 NA 0 0 0 0 0 0
14 1994-01-21 0 1 1970-01-01 1994-02-04 NA -10 NA 0 0 0 0 0 0
15 1994-01-24 0 1 1970-01-01 1994-02-04 NA -9 NA 0 0 0 0 0 0
16 1994-01-25 0 1 1970-01-01 1994-02-04 NA -8 NA 0 0 0 0 0 0
17 1994-01-26 0 1 1970-01-01 1994-02-04 NA -7 NA 0 0 0 0 0 0
18 1994-01-27 0 1 1970-01-01 1994-02-04 NA -6 NA 0 0 0 0 0 0
19 1994-01-28 0 1 1970-01-01 1994-02-04 NA -5 NA 0 0 0 0 0 0
20 1994-01-31 0 1 1970-01-01 1994-02-04 NA -4 NA 0 0 0 0 0 0
21 1994-02-01 0 1 1970-01-01 1994-02-04 NA -3 NA 0 0 0 0 0 0
22 1994-02-02 0 1 1970-01-01 1994-02-04 NA -2 NA 0 0 0 0 0 0
23 1994-02-03 0 1 1970-01-01 1994-02-04 NA -1 0 1 0 0 0 1 0
24 1994-02-04 1 1 1994-02-04 1994-02-04 0 0 0 1 0 0 0 1 0
25 1994-02-07 1 2 1994-02-04 1994-03-22 1 -30 0 1 0 0 0 1 0
26 1994-02-08 1 2 1994-02-04 1994-03-22 2 -29 0 1 0 0 0 1 0
27 1994-02-09 1 2 1994-02-04 1994-03-22 3 -28 0 1 0 0 0 1 0
28 1994-02-10 1 2 1994-02-04 1994-03-22 4 -27 1 0 0 0 0 0 0
29 1994-02-11 1 2 1994-02-04 1994-03-22 5 -26 1 0 0 0 0 0 0
30 1994-02-14 1 2 1994-02-04 1994-03-22 6 -25 1 0 0 0 0 0 0
31 1994-02-15 1 2 1994-02-04 1994-03-22 7 -24 1 0 0 0 0 0 0
32 1994-02-16 1 2 1994-02-04 1994-03-22 8 -23 1 0 0 0 0 0 0
33 1994-02-17 1 2 1994-02-04 1994-03-22 9 -22 2 0 1 0 0 1 1
34 1994-02-18 1 2 1994-02-04 1994-03-22 10 -21 2 0 1 0 0 1 1
35 1994-02-22 1 2 1994-02-04 1994-03-22 11 -20 2 0 1 0 0 1 1
36 1994-02-23 1 2 1994-02-04 1994-03-22 12 -19 2 0 1 0 0 1 1
37 1994-02-24 1 2 1994-02-04 1994-03-22 13 -18 2 0 1 0 0 1 1
38 1994-02-25 1 2 1994-02-04 1994-03-22 14 -17 3 0 0 0 0 0 0
39 1994-02-28 1 2 1994-02-04 1994-03-22 15 -16 3 0 0 0 0 0 0
40 1994-03-01 1 2 1994-02-04 1994-03-22 16 -15 3 0 0 0 0 0 0
41 1994-03-02 1 2 1994-02-04 1994-03-22 17 -14 3 0 0 0 0 0 0
42 1994-03-03 1 2 1994-02-04 1994-03-22 18 -13 3 0 0 0 0 0 0
43 1994-03-04 1 2 1994-02-04 1994-03-22 19 -12 4 0 0 1 0 1 1
44 1994-03-07 1 2 1994-02-04 1994-03-22 20 -11 4 0 0 1 0 1 1
45 1994-03-08 1 2 1994-02-04 1994-03-22 21 -10 4 0 0 1 0 1 1
46 1994-03-09 1 2 1994-02-04 1994-03-22 22 -9 4 0 0 1 0 1 1
47 1994-03-10 1 2 1994-02-04 1994-03-22 23 -8 4 0 0 1 0 1 1
48 1994-03-11 1 2 1994-02-04 1994-03-22 24 -7 5 0 0 0 0 0 0
49 1994-03-14 1 2 1994-02-04 1994-03-22 25 -6 5 0 0 0 0 0 0
50 1994-03-15 1 2 1994-02-04 1994-03-22 26 -5 5 0 0 0 0 0 0
51 1994-03-16 1 2 1994-02-04 1994-03-22 27 -4 5 0 0 0 0 0 0
52 1994-03-17 1 2 1994-02-04 1994-03-22 28 -3 5 0 0 0 0 0 0
53 1994-03-18 1 2 1994-02-04 1994-03-22 29 -2 6 0 0 0 1 1 1
54 1994-03-21 1 2 1994-02-04 1994-03-22 30 -1 0 1 0 0 0 1 0
55 1994-03-22 2 2 1994-03-22 1994-03-22 0 0 0 1 0 0 0 1 0
56 1994-03-23 2 3 1994-03-22 1994-04-18 1 -18 0 1 0 0 0 1 0
57 1994-03-24 2 3 1994-03-22 1994-04-18 2 -17 0 1 0 0 0 1 0
58 1994-03-25 2 3 1994-03-22 1994-04-18 3 -16 0 1 0 0 0 1 0
59 1994-03-28 2 3 1994-03-22 1994-04-18 4 -15 1 0 0 0 0 0 0
60 1994-03-29 2 3 1994-03-22 1994-04-18 5 -14 1 0 0 0 0 0 0
61 1994-03-30 2 3 1994-03-22 1994-04-18 6 -13 1 0 0 0 0 0 0
62 1994-03-31 2 3 1994-03-22 1994-04-18 7 -12 1 0 0 0 0 0 0
63 1994-04-04 2 3 1994-03-22 1994-04-18 9 -10 2 0 1 0 0 1 1
64 1994-04-05 2 3 1994-03-22 1994-04-18 10 -9 2 0 1 0 0 1 1
65 1994-04-06 2 3 1994-03-22 1994-04-18 11 -8 2 0 1 0 0 1 1
66 1994-04-07 2 3 1994-03-22 1994-04-18 12 -7 2 0 1 0 0 1 1
67 1994-04-08 2 3 1994-03-22 1994-04-18 13 -6 2 0 1 0 0 1 1
68 1994-04-11 2 3 1994-03-22 1994-04-18 14 -5 3 0 0 0 0 0 0
69 1994-04-12 2 3 1994-03-22 1994-04-18 15 -4 3 0 0 0 0 0 0
70 1994-04-13 2 3 1994-03-22 1994-04-18 16 -3 3 0 0 0 0 0 0
71 1994-04-14 2 3 1994-03-22 1994-04-18 17 -2 3 0 0 0 0 0 0
72 1994-04-15 2 3 1994-03-22 1994-04-18 18 -1 0 1 0 0 0 1 0
73 1994-04-18 3 3 1994-04-18 1994-04-18 0 0 0 1 0 0 0 1 0
74 1994-04-19 3 4 1994-04-18 1994-05-17 1 -20 0 1 0 0 0 1 0
75 1994-04-20 3 4 1994-04-18 1994-05-17 2 -19 0 1 0 0 0 1 0
76 1994-04-21 3 4 1994-04-18 1994-05-17 3 -18 0 1 0 0 0 1 0
77 1994-04-22 3 4 1994-04-18 1994-05-17 4 -17 1 0 0 0 0 0 0
78 1994-04-25 3 4 1994-04-18 1994-05-17 5 -16 1 0 0 0 0 0 0
79 1994-04-26 3 4 1994-04-18 1994-05-17 6 -15 1 0 0 0 0 0 0
80 1994-04-27 3 4 1994-04-18 1994-05-17 7 -14 1 0 0 0 0 0 0
81 1994-04-28 3 4 1994-04-18 1994-05-17 8 -13 1 0 0 0 0 0 0
82 1994-04-29 3 4 1994-04-18 1994-05-17 9 -12 2 0 1 0 0 1 1
83 1994-05-02 3 4 1994-04-18 1994-05-17 10 -11 2 0 1 0 0 1 1
84 1994-05-03 3 4 1994-04-18 1994-05-17 11 -10 2 0 1 0 0 1 1
85 1994-05-04 3 4 1994-04-18 1994-05-17 12 -9 2 0 1 0 0 1 1
86 1994-05-05 3 4 1994-04-18 1994-05-17 13 -8 2 0 1 0 0 1 1
87 1994-05-06 3 4 1994-04-18 1994-05-17 14 -7 3 0 0 0 0 0 0
88 1994-05-09 3 4 1994-04-18 1994-05-17 15 -6 3 0 0 0 0 0 0
89 1994-05-10 3 4 1994-04-18 1994-05-17 16 -5 3 0 0 0 0 0 0
90 1994-05-11 3 4 1994-04-18 1994-05-17 17 -4 3 0 0 0 0 0 0
91 1994-05-12 3 4 1994-04-18 1994-05-17 18 -3 3 0 0 0 0 0 0
92 1994-05-13 3 4 1994-04-18 1994-05-17 19 -2 4 0 0 1 0 1 1
93 1994-05-16 3 4 1994-04-18 1994-05-17 20 -1 0 1 0 0 0 1 0
94 1994-05-17 4 4 1994-05-17 1994-05-17 0 0 0 1 0 0 0 1 0
95 1994-05-18 4 5 1994-05-17 1994-07-06 1 -33 0 1 0 0 0 1 0
96 1994-05-19 4 5 1994-05-17 1994-07-06 2 -32 0 1 0 0 0 1 0
97 1994-05-20 4 5 1994-05-17 1994-07-06 3 -31 0 1 0 0 0 1 0
98 1994-05-23 4 5 1994-05-17 1994-07-06 4 -30 1 0 0 0 0 0 0
99 1994-05-24 4 5 1994-05-17 1994-07-06 5 -29 1 0 0 0 0 0 0
100 1994-05-25 4 5 1994-05-17 1994-07-06 6 -28 1 0 0 0 0 0 0
6298 2018-12-14 208 209 2018-11-08 2018-12-19 24 -3 5 0 0 0 0 0 0
6299 2018-12-17 208 209 2018-11-08 2018-12-19 25 -2 5 0 0 0 0 0 0
6300 2018-12-18 208 209 2018-11-08 2018-12-19 26 -1 0 1 0 0 0 1 0
6301 2018-12-19 209 209 2018-12-19 2018-12-19 0 0 0 1 0 0 0 1 0
6302 2018-12-20 209 210 2018-12-19 2019-01-30 1 -26 0 1 0 0 0 1 0
6303 2018-12-21 209 210 2018-12-19 2019-01-30 2 -25 0 1 0 0 0 1 0
6304 2018-12-24 209 210 2018-12-19 2019-01-30 3 -24 0 1 0 0 0 1 0
6305 2018-12-26 209 210 2018-12-19 2019-01-30 4 -23 1 0 0 0 0 0 0
6306 2018-12-27 209 210 2018-12-19 2019-01-30 5 -22 1 0 0 0 0 0 0
6307 2018-12-28 209 210 2018-12-19 2019-01-30 6 -21 1 0 0 0 0 0 0
6308 2018-12-31 209 210 2018-12-19 2019-01-30 7 -20 1 0 0 0 0 0 0
6309 2019-01-02 209 210 2018-12-19 2019-01-30 8 -19 1 0 0 0 0 0 0
6310 2019-01-03 209 210 2018-12-19 2019-01-30 9 -18 2 0 1 0 0 1 1
6311 2019-01-04 209 210 2018-12-19 2019-01-30 10 -17 2 0 1 0 0 1 1
6312 2019-01-07 209 210 2018-12-19 2019-01-30 11 -16 2 0 1 0 0 1 1
6313 2019-01-08 209 210 2018-12-19 2019-01-30 12 -15 2 0 1 0 0 1 1
6314 2019-01-09 209 210 2018-12-19 2019-01-30 13 -14 2 0 1 0 0 1 1
6315 2019-01-10 209 210 2018-12-19 2019-01-30 14 -13 3 0 0 0 0 0 0
6316 2019-01-11 209 210 2018-12-19 2019-01-30 15 -12 3 0 0 0 0 0 0
6317 2019-01-14 209 210 2018-12-19 2019-01-30 16 -11 3 0 0 0 0 0 0
6318 2019-01-15 209 210 2018-12-19 2019-01-30 17 -10 3 0 0 0 0 0 0
6319 2019-01-16 209 210 2018-12-19 2019-01-30 18 -9 3 0 0 0 0 0 0
6320 2019-01-17 209 210 2018-12-19 2019-01-30 19 -8 4 0 0 1 0 1 1
6321 2019-01-18 209 210 2018-12-19 2019-01-30 20 -7 4 0 0 1 0 1 1
6322 2019-01-22 209 210 2018-12-19 2019-01-30 21 -6 4 0 0 1 0 1 1
6323 2019-01-23 209 210 2018-12-19 2019-01-30 22 -5 4 0 0 1 0 1 1
6324 2019-01-24 209 210 2018-12-19 2019-01-30 23 -4 4 0 0 1 0 1 1
6325 2019-01-25 209 210 2018-12-19 2019-01-30 24 -3 5 0 0 0 0 0 0
6326 2019-01-28 209 210 2018-12-19 2019-01-30 25 -2 5 0 0 0 0 0 0
6327 2019-01-29 209 210 2018-12-19 2019-01-30 26 -1 0 1 0 0 0 1 0
6328 2019-01-30 210 210 2019-01-30 2019-01-30 0 0 0 1 0 0 0 1 0
6329 2019-01-31 210 211 2019-01-30 2019-03-20 1 -33 0 1 0 0 0 1 0
6330 2019-02-01 210 211 2019-01-30 2019-03-20 2 -32 0 1 0 0 0 1 0
6331 2019-02-04 210 211 2019-01-30 2019-03-20 3 -31 0 1 0 0 0 1 0
6332 2019-02-05 210 211 2019-01-30 2019-03-20 4 -30 1 0 0 0 0 0 0
6333 2019-02-06 210 211 2019-01-30 2019-03-20 5 -29 1 0 0 0 0 0 0
6334 2019-02-07 210 211 2019-01-30 2019-03-20 6 -28 1 0 0 0 0 0 0
6335 2019-02-08 210 211 2019-01-30 2019-03-20 7 -27 1 0 0 0 0 0 0
6336 2019-02-11 210 211 2019-01-30 2019-03-20 8 -26 1 0 0 0 0 0 0
6337 2019-02-12 210 211 2019-01-30 2019-03-20 9 -25 2 0 1 0 0 1 1
6338 2019-02-13 210 211 2019-01-30 2019-03-20 10 -24 2 0 1 0 0 1 1
6339 2019-02-14 210 211 2019-01-30 2019-03-20 11 -23 2 0 1 0 0 1 1
6340 2019-02-15 210 211 2019-01-30 2019-03-20 12 -22 2 0 1 0 0 1 1
6341 2019-02-19 210 211 2019-01-30 2019-03-20 13 -21 2 0 1 0 0 1 1
6342 2019-02-20 210 211 2019-01-30 2019-03-20 14 -20 3 0 0 0 0 0 0
6343 2019-02-21 210 211 2019-01-30 2019-03-20 15 -19 3 0 0 0 0 0 0
6344 2019-02-22 210 211 2019-01-30 2019-03-20 16 -18 3 0 0 0 0 0 0
6345 2019-02-25 210 211 2019-01-30 2019-03-20 17 -17 3 0 0 0 0 0 0
6346 2019-02-26 210 211 2019-01-30 2019-03-20 18 -16 3 0 0 0 0 0 0
6347 2019-02-27 210 211 2019-01-30 2019-03-20 19 -15 4 0 0 1 0 1 1
6348 2019-02-28 210 211 2019-01-30 2019-03-20 20 -14 4 0 0 1 0 1 1
6349 2019-03-01 210 211 2019-01-30 2019-03-20 21 -13 4 0 0 1 0 1 1
6350 2019-03-04 210 211 2019-01-30 2019-03-20 22 -12 4 0 0 1 0 1 1
6351 2019-03-05 210 211 2019-01-30 2019-03-20 23 -11 4 0 0 1 0 1 1
6352 2019-03-06 210 211 2019-01-30 2019-03-20 24 -10 5 0 0 0 0 0 0
6353 2019-03-07 210 211 2019-01-30 2019-03-20 25 -9 5 0 0 0 0 0 0
6354 2019-03-08 210 211 2019-01-30 2019-03-20 26 -8 5 0 0 0 0 0 0
6355 2019-03-11 210 211 2019-01-30 2019-03-20 27 -7 5 0 0 0 0 0 0
6356 2019-03-12 210 211 2019-01-30 2019-03-20 28 -6 5 0 0 0 0 0 0
6357 2019-03-13 210 211 2019-01-30 2019-03-20 29 -5 6 0 0 0 1 1 1
6358 2019-03-14 210 211 2019-01-30 2019-03-20 30 -4 6 0 0 0 1 1 1
6359 2019-03-15 210 211 2019-01-30 2019-03-20 31 -3 6 0 0 0 1 1 1
6360 2019-03-18 210 211 2019-01-30 2019-03-20 32 -2 6 0 0 0 1 1 1
6361 2019-03-19 210 211 2019-01-30 2019-03-20 33 -1 0 1 0 0 0 1 0
6362 2019-03-20 211 211 2019-03-20 2019-03-20 0 0 0 1 0 0 0 1 0
6363 2019-03-21 211 212 2019-03-20 1970-01-01 1 NA 0 1 0 0 0 1 0
6364 2019-03-22 211 212 2019-03-20 1970-01-01 2 NA 0 1 0 0 0 1 0
6365 2019-03-25 211 212 2019-03-20 1970-01-01 3 NA 0 1 0 0 0 1 0
6366 2019-03-26 211 212 2019-03-20 1970-01-01 4 NA 1 0 0 0 0 0 0
6367 2019-03-27 211 212 2019-03-20 1970-01-01 5 NA 1 0 0 0 0 0 0
6368 2019-03-28 211 212 2019-03-20 1970-01-01 6 NA 1 0 0 0 0 0 0
6369 2019-03-29 211 212 2019-03-20 1970-01-01 7 NA 1 0 0 0 0 0 0
6370 2019-04-01 211 212 2019-03-20 1970-01-01 8 NA 1 0 0 0 0 0 0
6371 2019-04-02 211 212 2019-03-20 1970-01-01 9 NA 2 0 1 0 0 1 1
6372 2019-04-03 211 212 2019-03-20 1970-01-01 10 NA 2 0 1 0 0 1 1
6373 2019-04-04 211 212 2019-03-20 1970-01-01 11 NA 2 0 1 0 0 1 1
6374 2019-04-05 211 212 2019-03-20 1970-01-01 12 NA 2 0 1 0 0 1 1
6375 2019-04-08 211 212 2019-03-20 1970-01-01 13 NA 2 0 1 0 0 1 1
6376 2019-04-09 211 212 2019-03-20 1970-01-01 14 NA 3 0 0 0 0 0 0
6377 2019-04-10 211 212 2019-03-20 1970-01-01 15 NA 3 0 0 0 0 0 0
6378 2019-04-11 211 212 2019-03-20 1970-01-01 16 NA 3 0 0 0 0 0 0
6379 2019-04-12 211 212 2019-03-20 1970-01-01 17 NA 3 0 0 0 0 0 0
6380 2019-04-15 211 212 2019-03-20 1970-01-01 18 NA 3 0 0 0 0 0 0
6381 2019-04-16 211 212 2019-03-20 1970-01-01 19 NA 4 0 0 1 0 1 1
6382 2019-04-17 211 212 2019-03-20 1970-01-01 20 NA 4 0 0 1 0 1 1
6383 2019-04-18 211 212 2019-03-20 1970-01-01 21 NA 4 0 0 1 0 1 1
6384 2019-04-22 211 212 2019-03-20 1970-01-01 23 NA 4 0 0 1 0 1 1
6385 2019-04-23 211 212 2019-03-20 1970-01-01 24 NA 5 0 0 0 0 0 0
6386 2019-04-24 211 212 2019-03-20 1970-01-01 25 NA 5 0 0 0 0 0 0
6387 2019-04-25 211 212 2019-03-20 1970-01-01 26 NA 5 0 0 0 0 0 0
6388 2019-04-26 211 212 2019-03-20 1970-01-01 27 NA 5 0 0 0 0 0 0
6389 2019-04-29 211 212 2019-03-20 1970-01-01 28 NA 5 0 0 0 0 0 0
6390 2019-04-30 211 212 2019-03-20 1970-01-01 29 NA 6 0 0 0 1 1 1
6391 2019-05-01 211 212 2019-03-20 1970-01-01 30 NA 6 0 0 0 1 1 1
6392 2019-05-02 211 212 2019-03-20 1970-01-01 31 NA 6 0 0 0 1 1 1
6393 2019-05-03 211 212 2019-03-20 1970-01-01 32 NA 6 0 0 0 1 1 1
6394 2019-05-06 211 212 2019-03-20 1970-01-01 33 NA 6 0 0 0 1 1 1
6395 2019-05-07 211 212 2019-03-20 1970-01-01 34 NA 7 0 0 0 0 0 0
6396 2019-05-08 211 212 2019-03-20 1970-01-01 35 NA 7 0 0 0 0 0 0
6397 2019-05-09 211 212 2019-03-20 1970-01-01 36 NA 7 0 0 0 0 0 0
6398 2019-05-10 211 212 2019-03-20 1970-01-01 37 NA 7 0 0 0 0 0 0
write_csv(cycle_data, "cycle_data.csv")

Merge the Cycle and Excess Return Data

Now we combine the FOMC cycle and equity excess return data in order to stage the regression analysis.

eq_data %>% inner_join( cycle_data, by = c("mdyDate" = "trade_date")) -> mgData

mgData %>% filter(  mdyDate > mdy("3-20-1994") ) %>% filter(mdyDate < mdy("5-07-2019")) %>%
select( mdyDate, excess_ret, lowerFOMC, offsetL, offsetU, weekNum, 
        dum_w0, dum_w2, dum_w4, dum_w6, dum_w246, dum_w0246) ->usable

dim(usable)
## [1] 6341   12
usable[c(1:100,(N-100):N),] %>% kable() %>% kable_styling() %>% scroll_box(height="300px", width="100%")
mdyDate excess_ret lowerFOMC offsetL offsetU weekNum dum_w0 dum_w2 dum_w4 dum_w6 dum_w246 dum_w0246
1994-03-21 -0.0210328 1994-02-04 30 -1 0 1 0 0 0 0 1
1994-03-22 -0.0187814 1994-03-22 0 0 0 1 0 0 0 0 1
1994-03-23 -0.0353953 1994-03-22 1 -18 0 1 0 0 0 0 1
1994-03-24 -0.0495048 1994-03-22 2 -17 0 1 0 0 0 0 1
1994-03-25 -0.0405128 1994-03-22 3 -16 0 1 0 0 0 0 1
1994-03-28 -0.0483680 1994-03-22 4 -15 1 0 0 0 0 0 0
1994-03-29 -0.0245698 1994-03-22 5 -14 1 0 0 0 0 0 0
1994-03-30 -0.0077478 1994-03-22 6 -13 1 0 0 0 0 0 0
1994-03-31 0.0130297 1994-03-22 7 -12 1 0 0 0 0 0 0
1994-04-04 0.0046361 1994-03-22 9 -10 2 0 1 0 0 1 1
1994-04-05 0.0243830 1994-03-22 10 -9 2 0 1 0 0 1 1
1994-04-06 -0.0029667 1994-03-22 11 -8 2 0 1 0 0 1 1
1994-04-07 -0.0072559 1994-03-22 12 -7 2 0 1 0 0 1 1
1994-04-08 -0.0125230 1994-03-22 13 -6 2 0 1 0 0 1 1
1994-04-11 -0.0037591 1994-03-22 14 -5 3 0 0 0 0 0 0
1994-04-12 -0.0158762 1994-03-22 15 -4 3 0 0 0 0 0 0
1994-04-13 -0.0116731 1994-03-22 16 -3 3 0 0 0 0 0 0
1994-04-14 -0.0093456 1994-03-22 17 -2 3 0 0 0 0 0 0
1994-04-15 0.0050614 1994-03-22 18 -1 0 1 0 0 0 0 1
1994-04-18 0.0031296 1994-04-18 0 0 0 1 0 0 0 0 1
1994-04-19 0.0215413 1994-04-18 1 -20 0 1 0 0 0 0 1
1994-04-20 0.0213383 1994-04-18 2 -19 0 1 0 0 0 0 1
1994-04-21 0.0233654 1994-04-18 3 -18 0 1 0 0 0 0 1
1994-04-22 0.0013590 1994-04-18 4 -17 1 0 0 0 0 0 0
1994-04-25 0.0078907 1994-04-18 5 -16 1 0 0 0 0 0 0
1994-04-26 0.0034350 1994-04-18 6 -15 1 0 0 0 0 0 0
1994-04-27 0.0038322 1994-04-18 7 -14 1 0 0 0 0 0 0
1994-04-28 0.0021484 1994-04-18 8 -13 1 0 0 0 0 0 0
1994-04-29 0.0077041 1994-04-18 9 -12 2 0 1 0 0 1 1
1994-05-02 -0.0062701 1994-04-18 10 -11 2 0 1 0 0 1 1
1994-05-03 -0.0244018 1994-04-18 11 -10 2 0 1 0 0 1 1
1994-05-04 -0.0168900 1994-04-18 12 -9 2 0 1 0 0 1 1
1994-05-05 -0.0255738 1994-04-18 13 -8 2 0 1 0 0 1 1
1994-05-06 -0.0203375 1994-04-18 14 -7 3 0 0 0 0 0 0
1994-05-09 -0.0101974 1994-04-18 15 -6 3 0 0 0 0 0 0
1994-05-10 0.0021557 1994-04-18 16 -5 3 0 0 0 0 0 0
1994-05-11 0.0050461 1994-04-18 17 -4 3 0 0 0 0 0 0
1994-05-12 0.0274793 1994-04-18 18 -3 3 0 0 0 0 0 0
1994-05-13 0.0292701 1994-04-18 19 -2 4 0 0 1 0 1 1
1994-05-16 0.0251154 1994-04-18 20 -1 0 1 0 0 0 0 1
1994-05-17 0.0216668 1994-05-17 0 0 0 1 0 0 0 0 1
1994-05-18 0.0157325 1994-05-17 1 -33 0 1 0 0 0 0 1
1994-05-19 0.0074745 1994-05-17 2 -32 0 1 0 0 0 0 1
1994-05-20 0.0032194 1994-05-17 3 -31 0 1 0 0 0 0 1
1994-05-23 0.0065613 1994-05-17 4 -30 1 0 0 0 0 0 0
1994-05-24 0.0084337 1994-05-17 5 -29 1 0 0 0 0 0 0
1994-05-25 0.0073247 1994-05-17 6 -28 1 0 0 0 0 0 0
1994-05-26 0.0048190 1994-05-17 7 -27 1 0 0 0 0 0 0
1994-05-27 0.0082275 1994-05-17 8 -26 1 0 0 0 0 0 0
1994-05-31 0.0069088 1994-05-17 9 -25 2 0 1 0 0 1 1
1994-06-01 0.0066102 1994-05-17 10 -24 2 0 1 0 0 1 1
1994-06-02 -0.0009171 1994-05-17 11 -23 2 0 1 0 0 1 1
1994-06-03 -0.0007791 1994-05-17 12 -22 2 0 1 0 0 1 1
1994-06-06 -0.0035048 1994-05-17 13 -21 2 0 1 0 0 1 1
1994-06-07 -0.0018455 1994-05-17 14 -20 3 0 0 0 0 0 0
1994-06-08 0.0067265 1994-05-17 15 -19 3 0 0 0 0 0 0
1994-06-09 0.0071897 1994-05-17 16 -18 3 0 0 0 0 0 0
1994-06-10 0.0088070 1994-05-17 17 -17 3 0 0 0 0 0 0
1994-06-13 -0.0010746 1994-05-17 18 -16 3 0 0 0 0 0 0
1994-06-14 -0.0103998 1994-05-17 19 -15 4 0 0 1 0 1 1
1994-06-15 -0.0256128 1994-05-17 20 -14 4 0 0 1 0 1 1
1994-06-16 -0.0187953 1994-05-17 21 -13 4 0 0 1 0 1 1
1994-06-17 -0.0294851 1994-05-17 22 -12 4 0 0 1 0 1 1
1994-06-20 -0.0357955 1994-05-17 23 -11 4 0 0 1 0 1 1
1994-06-21 -0.0179402 1994-05-17 24 -10 5 0 0 0 0 0 0
1994-06-22 -0.0113706 1994-05-17 25 -9 5 0 0 0 0 0 0
1994-06-23 -0.0108932 1994-05-17 26 -8 5 0 0 0 0 0 0
1994-06-24 -0.0094538 1994-05-17 27 -7 5 0 0 0 0 0 0
1994-06-27 0.0092288 1994-05-17 28 -6 5 0 0 0 0 0 0
1994-06-28 -0.0006267 1994-05-17 29 -5 6 0 0 0 1 1 1
1994-06-29 0.0016296 1994-05-17 30 -4 6 0 0 0 1 1 1
1994-06-30 0.0029705 1994-05-17 31 -3 6 0 0 0 1 1 1
1994-07-01 0.0121674 1994-05-17 32 -2 6 0 0 0 1 1 1
1994-07-05 0.0042014 1994-05-17 33 -1 0 1 0 0 0 0 1
1994-07-06 0.0046580 1994-07-06 0 0 0 1 0 0 0 0 1
1994-07-07 0.0080978 1994-07-06 1 -28 0 1 0 0 0 0 1
1994-07-08 0.0133231 1994-07-06 2 -27 0 1 0 0 0 0 1
1994-07-11 0.0118942 1994-07-06 3 -26 0 1 0 0 0 0 1
1994-07-12 0.0173803 1994-07-06 4 -25 1 0 0 0 0 0 0
1994-07-13 0.0138770 1994-07-06 5 -24 1 0 0 0 0 0 0
1994-07-14 0.0048415 1994-07-06 6 -23 1 0 0 0 0 0 0
1994-07-15 -0.0038173 1994-07-06 7 -22 1 0 0 0 0 0 0
1994-07-18 -0.0033421 1994-07-06 8 -21 1 0 0 0 0 0 0
1994-07-19 -0.0030818 1994-07-06 9 -20 2 0 1 0 0 1 1
1994-07-20 -0.0018809 1994-07-06 10 -19 2 0 1 0 0 1 1
1994-07-21 0.0015501 1994-07-06 11 -18 2 0 1 0 0 1 1
1994-07-22 0.0032247 1994-07-06 12 -17 2 0 1 0 0 1 1
1994-07-25 0.0114930 1994-07-06 13 -16 2 0 1 0 0 1 1
1994-07-26 0.0150376 1994-07-06 14 -15 3 0 0 0 0 0 0
1994-07-27 0.0180293 1994-07-06 15 -14 3 0 0 0 0 0 0
1994-07-28 0.0204283 1994-07-06 16 -13 3 0 0 0 0 0 0
1994-07-29 0.0114715 1994-07-06 17 -12 3 0 0 0 0 0 0
1994-08-01 -0.0013280 1994-07-06 18 -11 3 0 0 0 0 0 0
1994-08-02 -0.0047947 1994-07-06 19 -10 4 0 0 1 0 1 1
1994-08-03 -0.0051175 1994-07-06 20 -9 4 0 0 1 0 1 1
1994-08-04 0.0002237 1994-07-06 21 -8 4 0 0 1 0 1 1
1994-08-05 0.0028348 1994-07-06 22 -7 4 0 0 1 0 1 1
1994-08-08 0.0121197 1994-07-06 23 -6 4 0 0 1 0 1 1
1994-08-09 0.0093173 1994-07-06 24 -5 5 0 0 0 0 0 0
1994-08-10 0.0155663 1994-07-06 25 -4 5 0 0 0 0 0 0
2019-03-05 -0.0034537 2019-01-30 23 -11 4 0 0 1 0 1 1
2019-03-06 0.0007886 2019-01-30 24 -10 5 0 0 0 0 0 0
2019-03-07 0.0146817 2019-01-30 25 -9 5 0 0 0 0 0 0
2019-03-08 0.0219808 2019-01-30 26 -8 5 0 0 0 0 0 0
2019-03-11 0.0289024 2019-01-30 27 -7 5 0 0 0 0 0 0
2019-03-12 0.0178914 2019-01-30 28 -6 5 0 0 0 0 0 0
2019-03-13 0.0144059 2019-01-30 29 -5 6 0 0 0 1 1 1
2019-03-14 0.0043316 2019-01-30 30 -4 6 0 0 0 1 1 1
2019-03-15 0.0163180 2019-01-30 31 -3 6 0 0 0 1 1 1
2019-03-18 -0.0082957 2019-01-30 32 -2 6 0 0 0 1 1 1
2019-03-19 -0.0129618 2019-01-30 33 -1 0 1 0 0 0 0 1
2019-03-20 -0.0052645 2019-03-20 0 0 0 1 0 0 0 0 1
2019-03-21 -0.0067162 2019-03-20 1 NA 0 1 0 0 0 0 1
2019-03-22 -0.0137404 2019-03-20 2 NA 0 1 0 0 0 0 1
2019-03-25 0.0127873 2019-03-20 3 NA 0 1 0 0 0 0 1
2019-03-26 0.0255684 2019-03-20 4 NA 1 0 0 0 0 0 0
2019-03-27 0.0180566 2019-03-20 5 NA 1 0 0 0 0 0 0
2019-03-28 0.0253335 2019-03-20 6 NA 1 0 0 0 0 0 0
2019-03-29 0.0229523 2019-03-20 7 NA 1 0 0 0 0 0 0
2019-04-01 0.0210645 2019-03-20 8 NA 1 0 0 0 0 0 0
2019-04-02 0.0102924 2019-03-20 9 NA 2 0 1 0 0 1 1
2019-04-03 0.0041942 2019-03-20 10 NA 2 0 1 0 0 1 1
2019-04-04 0.0058835 2019-03-20 11 NA 2 0 1 0 0 1 1
2019-04-05 0.0042440 2019-03-20 12 NA 2 0 1 0 0 1 1
2019-04-08 0.0061241 2019-03-20 13 NA 2 0 1 0 0 1 1
2019-04-09 0.0043680 2019-03-20 14 NA 3 0 0 0 0 0 0
2019-04-10 0.0108090 2019-03-20 15 NA 3 0 0 0 0 0 0
2019-04-11 0.0037001 2019-03-20 16 NA 3 0 0 0 0 0 0
2019-04-12 0.0050002 2019-03-20 17 NA 3 0 0 0 0 0 0
2019-04-15 -0.0009030 2019-03-20 18 NA 3 0 0 0 0 0 0
2019-04-16 0.0090242 2019-03-20 19 NA 4 0 0 1 0 1 1
2019-04-17 0.0067250 2019-03-20 20 NA 4 0 0 1 0 1 1
2019-04-18 0.0087846 2019-03-20 21 NA 4 0 0 1 0 1 1
2019-04-22 0.0123194 2019-03-20 23 NA 4 0 0 1 0 1 1
2019-04-23 0.0126231 2019-03-20 24 NA 5 0 0 0 0 0 0
2019-04-24 0.0042882 2019-03-20 25 NA 5 0 0 0 0 0 0
2019-04-25 -0.0013714 2019-03-20 26 NA 5 0 0 0 0 0 0
2019-04-26 -0.0023895 2019-03-20 27 NA 5 0 0 0 0 0 0
2019-04-29 0.0025937 2019-03-20 28 NA 5 0 0 0 0 0 0
2019-04-30 -0.0027154 2019-03-20 29 NA 6 0 0 0 1 1 1
2019-05-01 -0.0203024 2019-03-20 30 NA 6 0 0 0 1 1 1
2019-05-02 -0.0143796 2019-03-20 31 NA 6 0 0 0 1 1 1
2019-05-03 -0.0149972 2019-03-20 32 NA 6 0 0 0 1 1 1
2019-05-06 -0.0209666 2019-03-20 33 NA 6 0 0 0 1 1 1
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA
write_csv(usable, "usable.csv")

write_rds(usable, "usable.rds")

Regression Analysis of the usable data

In our regression models below, we don’t detect statistical significance in the linear regression on the coefficients of the variables. This is somewhat puzzling given that the paper is quite precise in providing data construction methodology for the FOMC cycle.

We illustrate with two regression models: one on the dummy of the even weeks and another on the offset days themselves which is more granular.

mod2 = lm(excess_ret ~ factor(dum_w0) + factor(dum_w2) + factor(dum_w4) + factor(dum_w6) , data = usable )
summary(mod2)
## 
## Call:
## lm(formula = excess_ret ~ factor(dum_w0) + factor(dum_w2) + factor(dum_w4) + 
##     factor(dum_w6), data = usable)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.187151 -0.011548  0.001456  0.013146  0.194200 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     1.606e-03  4.397e-04   3.652 0.000262 ***
## factor(dum_w0)1 7.927e-05  8.554e-04   0.093 0.926171    
## factor(dum_w2)1 1.619e-03  8.615e-04   1.880 0.060176 .  
## factor(dum_w4)1 7.626e-04  8.920e-04   0.855 0.392628    
## factor(dum_w6)1 1.976e-03  1.323e-03   1.493 0.135510    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02384 on 6336 degrees of freedom
## Multiple R-squared:  0.0008542,  Adjusted R-squared:  0.0002235 
## F-statistic: 1.354 on 4 and 6336 DF,  p-value: 0.2472
plot(mod2)

mod4 = lm(excess_ret ~ offsetL, data=usable)
summary(mod4)
## 
## Call:
## lm(formula = excess_ret ~ offsetL, data = usable)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.185930 -0.011545  0.001475  0.013102  0.193649 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)  
## (Intercept) 1.340e-03  5.634e-04   2.379   0.0174 *
## offsetL     5.103e-05  3.161e-05   1.614   0.1065  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02384 on 6339 degrees of freedom
## Multiple R-squared:  0.000411,   Adjusted R-squared:  0.0002533 
## F-statistic: 2.606 on 1 and 6339 DF,  p-value: 0.1065
plot(mod4)

Neither model appears to be statistically significant. Other variations produced the same results.

Visualizations

The 5-day mean excess return conditional on the offset days does show the pattern that we observe in the author’s paper.

usable %>% group_by( offsetL) %>% summarize( fret = mean( excess_ret)) -> fret_by_offsetL

ggplot( data = fret_by_offsetL) + geom_line(aes(x=offsetL, y= fret)) + ggtitle("5-day excess returns vs. FOMC cycle date", subtitle="1994-2019")

ggplot(data = usable, aes(x=offsetL, y=excess_ret)) + geom_boxplot()

Conclusion

We conclude and replicate the key pattern observed by the authors using the Russell 1000 Equity Index instead of the SP500 Index. During the even-numbered weeks of the FOMC cycle, the equity returns are significantly higher than during odd-numbered weeks of the cycle.

However, the regression of excess returns to dummies of the even weeks does not produce the expected results. While I suspect that implementation issues may be causing the lack of results, this is a puzzle for two reasons. The chart of excess returns vs. FOMC cycle day exactly matches the papers in the figure 1 of the authors’ paper. Secondly, the excess returns displays in a scatter plot show a high degree of dispersion within each offset day. However, there are noticeable but subtle shifts in mean on even numbered days: 0, 9, 20, 30. This suggests that the pattern may be economically significant but harder to show statistical significance.

References