help for eventstudy2beta

eventstudy2 - A module to perform event studies with complex test statistics

EXAMPLES AND DATA ARE AVAILABLE BELOW. IT IS RECOMMENDED TO FRIST GET THESE EXAMPLES RUNNNING AND THEN APPLYING eventstudy2 TO ONE'S OWN DATA.

NEW IN THIS VERSION:

1) Built-in version of nearmrg, which solves the problem of unstable sorts (see Statalist)
2) Correction of a minor error in the calculation of the Kolari + Pynnonen (2010 ) adjustment; the prior version slightly overestimated the cross-correlation by not disregarding the i = j = 1.00 cross-correlations.
3) Option KOLBlock (see below)

eventstudy2
security_id date using security_returns_file,
returns:(security_returns) [model:(abnormal_return_model) marketfile(file_with_market/factor_returns)
marketreturns:(market_returns) idmarket:(market_id) factor1(factor_return1) factor2(factor_return2) factor3(factor_return3)
factor4(factor_return4) factor5(factor_return5)
factor6(factor_return6) factor7(factor_return7)
factor8(factor_return8) factor9(factor_return9)
factor10(factor_return10) factor11(factor_return11)
factor12(factor_return12)
riskfreerate(risk_free_rate) prices(prices) tradingvolume(trading_volume)
evwlb(event_window_lower_boundary) evwub(event_window_upper_boundary) eswlb(estimation_window_lower_boundary) eswub(estimation_window_upper_boundary)
minevw(minimum_observations_event_window) minesw(minimum_observations_estimation_window)
aarfile:(output_average_abn_ret_file) carfile:(output_cum_average_abn_ret_file) arfile:(output_abn_ret_file)
crossfile:(output_cross_sec_file) diagnosticsfile:(output_diag_file) graphfile:(output_graph_file) replace
logreturns thin(thin_trading_threshold) fill nokolari kolblock(cross_sec_corr_block) delweekend datelinethreshold(dateline_threshold)
shift(maximum_event_date_shift)
garch archoption:(arch_option) garchoption:(garch_option) architerate:(iterations)
parallel pclusters:(clusters) processors:(processors_StataMP) prapath:(path_eventstudy2_parallel)
arfillevent arfillestimation
car1LB(CAR_window_1_lower_boundary) car1UB(CAR_window_1_upper_boundary) car2LB(CAR_window_2_lower_boundary)
car2UB(CAR_window_2_upper_boundary) car3LB(CAR_window_3_lower_boundary) car3UB(CAR_window_3_upper_boundary)
car4LB(CAR_window_4_lower_boundary) car4UB(CAR_window_4_upper_boundary) car5LB(CAR_window_5_lower_boundary)
car5UB(CAR_window_5_upper_boundary) car6LB(CAR_window_6_lower_boundary) car6UB(CAR_window_6_upper_boundary)
car7LB(CAR_window_7_lower_boundary) car7UB(CAR_window_7_upper_boundary) car8LB(CAR_window_8_lower_boundary)
car8UB(CAR_window_8_upper_boundary) car9LB(CAR_window_9_lower_boundary) car9UB(CAR_window_9_upper_boundary)
car10LB(CAR_window_10_lower_boundary) car10UB(CAR_window_10_upper_boundary)]

where

security_id is the name of the security or firm identifier variable in the event list that is currently held in memory.

date is the name of the of the event date variable in the event list that is currently held in memory.

security_returns_file is the name of the file that contains security returns (see option returns(security_returns)) that is stored in working directory. security_returns_file must also contain the variables
security_id and date, while here date refers to the dates for which the returns are observed rather than the event date.

Description

eventstudy2 performs event studies and allows the user to specify several model specifications that have been established in the finance and related literature, e.g. raw returns, the market model, multi-factor models and buy-and-hold abnormal returns. The length of estimation and event windows can be chosen freely and cumulative (average) abnormal (buy-and-hold) returns can be calculated over up to 10 windows. The output of eventstudy2 currently provides the following test statistics, which are all calculated using the Mata programming language:

The t-test assuming cross-sectional independence according to Serra (2002, p. 4).

The crude dependence adjustment test according to Brown and Warner (1980, pp. 223, 253).

The Patell test of standardized residuals (Patell, 1976, pp. 254-258).

The Boehmer test of standardized residuals corrected for event-induced changes in volatility (Boehmer et al., 1991, pp. 258-270).

The Kolari test of standardized residuals corrected for event-induced changes in volatility and cross-correlation (Kolari and Pynnönen, 2010, p. 4003).

The Corrado rank test (Corrado, 1989, pp. 387-388). For cumulative (average) abnormal returns, the aggregation formula in Cowan (1992, p. 346) is applied.

The Corrado and Zivney rank test corrected for event-induced volatility of rankings (Corrado and Zivney, 1992, pp. 345-346). For cumulative (average) abnormal returns, the aggregation formula in Cowan (1992, p. 346) is applied.

The generalized sign test according to Cowan (1992, pp. 345-346).

The GRANK test for average cumulative returns according to Kolari and Pynnönen (2011), including the Kolari and Pynnönen (2010) for cross-correlation (see Fn. 6 in Kolari and Pynnönen (2011)).

The Wilcoxon signed-ranks test according to Wilcoxon (1945).

The skewness-adjusted bootstrapped t-ratio test for buy-and-hold abnormal returns according to Lyon et al. (1999, pp. 173-175).

By default, thin trading is accounted for on a trade-to-trade basisa s suggested in Maynes and Rumsey (1993, pp. 148-149). eventstudy2 performs an
extensive meta-analysis on data availability. For instance, securities/firms that have insufficient oberservations in the estimation and/or event period are reported in the _Diagnostic file.
eventstudy2 also provides a graph that displays cumulative average abormal (buy-and-hold) return over the event window.

Citation

eventstudy2 is not an official Stata command.
It is a free contribution to the research community.
Please cite it as such:

Kaspereit, T. 2019. eventstudy2 - A program to perform event studies with complex test statistics in Stata (Version 3.0).

Options

returns(security_returns) specifies the name of the variable in security_returns_file that represents the security returns of the event firms.

model(abnormal_return_model) specifies the model to calculate abnormal returns. In the current version of eventstudy2,
the models RAW (raw returns), COMEAN (constant mean model), MA (market adjusted returns), FM (factor models, e.g. the market model and Fama and French (1992, 1993) factor models),
BHAR (buy-and-hold abnormal returns against a market index or factor) and BHAR_raw (raw buy-and-hold returns). If one the models MA, FM or BHAR is selected,
it is mandatory to specify the options marketfile and marketreturns. In models BHAR and BHAR_raw, missing returns are set to zero (see option fill)
while in all other models missing returns are dealt with on a trade-to-trade basis in accordance with Maynes and Rumsey (1993, pp. 148-149).

marketfile(file_with_market/factor_returns) specifies the file in which market returns are stored on disk. Market returns,
whose denomination is specific by the option marketreturns(market_returns), serve as benchmarks in the models MA, FM and BHAR (see option model),
against which abnormal returns are calculated. file_with_market/factor_returns also might contain additional factors (see options factor1
to factor5) and the risk free rate (see option riskfreerate).
file_with_market/factor_returns must contain the variable date, which has to have the same denomination
as in the event date variable of the dataset held in memory.

marketreturns(market_returns) specifies the variable denomination of the market returns in the file file_with_market/factor_returns (see option marketfile(file_with_market/factor_returns)).

idmarket(market_id) specifies the identifier of market and/or factor returns in both the event list held in memory (or alternatively the security returns file) and the market return file on disk
(see option marketfile(file_with_market/factor_returns)).
It is possible that certain events have different benchmarks, for instance in an international event study setting, security returns of U.S. firms are benchmarked against the S&P 500 index while UK firms are benchmarket against the FTSE100.
The variable market_id allows to assign different benchmarks to different events, though the event study and the calculation of the test statistics are performed on an aggregated basis.

factor1(factor_return1) to factor12(factor_return12), very similar to the option marketreturns(market_returns),
specifies the variable names for up to 5 factors used in multiple factor benchmark models (FM). eventstudy2 automatically adjusted test statistics for lower degrees
of freedom when more factors are used in the calculation of abnormal returns.

riskfreerate(risk_free_rate) specifies the variable denomination of the risk free rate in the file file_with_market/factor_returns (see option marketfile(file_with_market/factor_returns)).

prices(prices) specifies the variable denomination of security prices in the file
file_with_market/factor_returns (see option marketfile(file_with_market/factor_returns)).
The variable prices, if specified, is used to indentify return observations that suffer from thin trading. A return observation suffers from thin trading if
for the same trading day or the trading day before no prices are available.
It is also classified as suffering from thin trading if prices multiplied by trading_volume (see option tradingvolume(trading_volume))
is below the threshold specified by the option thin(thin_trading_threshold).

tradingvolume(trading_volume) specifies the variable denomination of trading volume (number of shares per day) in the file
file_with_market/factor_returns (see option marketfile(file_with_market/factor_returns)).
The variable trading_volume, if specified, is used to indentify return observations that suffer from thin trading.
A return observation suffers from thin trading if prices (see option prices(prices)) multiplied by
trading_volume is below the threshold specified by the option thin(thin_trading_threshold).

evwlb(event_window_lower_boundary) specifies the lower boundary of the event window, measured in trading days relative to the event date. The default value is -20.

evwub(event_window_upper_boundary) specifies the upper boundary of the event window, measured in trading days relative to the event date. The default value is 20.

eswlb(estimation_window_lower_boundary) specifies the lower boundary of the estimation window, measured in trading days relative to the event date. The default value is -270.

eswub(estimation_window_upper_boundary) specifies the upper boundary of the estimation window, measured in trading days relative to the event date. The default value is -20.

minevw(minimum_observations_event_window) specifies the minimum number of valid, i.e. non-thinly traded, returns observations in the event window.
If less than minimum_observations_event_window valid return observations are available, the event is excluded from the analysis and reported on the _Diagnostics file. The default value is 1.

minesw(minimum_observations_estimation_window) specifies the minimum number of valid, i.e. non-thinly traded, returns observations in the estimation window.
If less than minimum_observations_estimation_window valid return observations are available, the event is excluded from the analysis and reported on the _Diagnostics file. The default value is 30.

aarfile:(output_average_abn_ret_file) specifies the file name under which the dta-file that contains average abnormal returns will be saved. If not specified, the file name will be aarfile or
the module will abort if a file with the same denomination is already present and the replace option has not been called.

carfile:(output_cum_average_abn_ret_file) specifies the file name under which the dta-file that contains cumulative average abnormal returns will be saved.
If not specified, the file name will be carfile or
the module will abort if a file with the same denomination is already present and the replace option has not been called.

arfile:(output_abn_ret_file) specifies the file name under which the dta-file that contains abnormal abnormal returns will be saved.
If not specified, the file name will be arfile or
the module will abort if a file with the same denomination is already present and the replace option has not been called.

crossfile:(output_cross_sec_file) specifies the file name under which the dta-file that contains cumulative abnormal returns for the cross-sectional analysis will be saved. If not specified, the file name will be crossfile or
the module will abort if a file with the same denomination is already present and the replace option has not been called.

diagnosticsfile:(output_diag_file) specifies the file name under which the dta-file and the smcl-file that contain diagnostic sample statistics will be saved.
If not specified, the file names will be diagnosticsfile.dta and diagnosticsfile.smcl or
the module will abort if files with the same denominations are already present and the replace option has not been called.

graphfile:(output_graph_file) specifies the file name under which the gph-file that displays cumulative average abnormal returns will be saved. If not specified, the file name will be graphfile or
the module will abort if a file with the same denomination is already present and the replace option has not been called.

replace allows output files to be overwritten (see options aarfile:(output_average_abn_ret_file), carfile:(output_cum_average_abn_ret_file),
crossfile:(output_cross_sec_file), diagnosticsfile:(output_diag_file) and graphfile:(output_graph_file)).

logreturns specifies whether returns in the security_returns_file (see option returns(security_returns)) and file_with_market/factor_returns
(see option marketfile(file_with_market/factor_returns)) are continuously compounded returns. By default, eventstudy2 assumes that input returns are discrete, i.e.
calculated by the formula [(p_t+1-p_t)/p_t], where p is the dividend and stock splits adjusted share price, and transforms those returns to continuously compounded returns, i.e. [ln(p_t+1)-ln(p_t)] if abnormal_return_model is RAW, MA or FM. If abnormal_return_model is BHAR or BHAR_raw, returns are kept as discrete returns, or are transformed to discrete returns if option logreturns is specified.

thin(thin_trading_threshold) specifies the threshold for classifying security return observations as arising from thin trading. A security return observation is
classified as arising from thin trading if the trading volume, i.e. prices (see option prices(prices)) multiplied by trading_volume (see option
tradingvolume(trading_volume)) is lower than thin_trading_threshold.
All return observations that are classified as arising from thin trading are handled on a trade-to-trade basis as suggested in Maynes and Rumsey (1993, pp. 148-149).

fill specifies whether missing security and market returns are set to zero if missing. Nevertheless, missing returns are never set to zero if they are before the
first or after the last valid return observation in the file security_returns_file. It is strongly recommended to not use this option, except for models BHAR and BHAR_raw where this option is always activated.
eventstudy2 handles missing returns or returns that arise from thin trading in a very efficient way with a minimum loss in observations. Further, all test statistics account for such missing returns on a daily basis.

nokolari If this option is called, the Kolari and Pynnönen (2010, p. 4003) adjustment of the Boehmer et al. (1991, pp. 258-270) test is not calculated but set to 1. In this case
the Boehmer test equals the Kolari test. Calling this option might increase the calculation of test statistics dramatically since resource requirements to calculate the Kolari and Pynnönen adjustment increase quadratically in the number of events.

kolblock The Kolari and Pynnönen (2010, p. 4003) adjustment will be calculated under the assumption that abnormal returns have zero cross-correlations across the clusters defined by cross_sec_corr_block.

delweekend If this option is called, return observations at Saturdays and Sundays are never considered valid observations and are deleted from the analysis.

datelinethreshold(dateline_threshold) This option specifies a minimum threshold of return observation that should exit to include a particular trading day into the analysis.
It is useful to identify (international) holidays where only a few amount of securities are traded.
First, eventstudy2 calculated the number of return observation in the file security_returns_file by date. Then, all dates are deleted for which the number of return observations is lower than
dateline_threshold multiplied by the mean number of observations per day. A value of 0.2 for dateline_threshold has proven a good choice in previous studies.
If this option is not specified, any date on which there is at least one return observation from any security is considered a trading date on the date line.

shift(maximum_event_date_shift) eventstudy2 derives the set of valid dates (date line) from the file security_returns_file. If an event date does not coincide with any of those
dates, it is shifted to the next date on the date line. maximum_event_date_shift specifies the maximum number of calendar days an event date is shifted forward. The default value is 3.

garch invokes the estimation of a (G)ARCH model if the benchmark model is a (multi)factor model (FM). The options archoption:(arch_option), garchoption:(garch_option)
and architerate:(iterations)
determine the exakt specification of the (G)ARCH model.

archoption:(arch_option) specifies the ARCH terms. Specify archo(1) to include first-order terms, archo(1/2) to specify first- and second-order terms, archo(1/3) to specify first-, second-, and third-order terms, etc.

garchoption:(garch_option) specifies the GARCH terms. Specify garcho(1) to include first-order terms, garcho(1/2) to specify first- and second-order terms, garcho(1/3) to specify first-, second-, and third-order terms, etc.

architerate:(iterations) specifies the maximum number of iterations in a (G)ARCH estimation.

parallel invokes parallel computing capabilities using the user-written command "parallel" by George Vega Yon and Brian Quistoff (https://ideas.repec.org/c/boc/bocode/s457527.html).
This option requires the presense of "eventstudy2_parallel.do" in the path specified by prapath:(path_eventstudy2_parallel).

pclusters:(clusters) specifies the number of clusters if parallel is selected. This number should not be higher than the number of CPUs. The default value is 2.

processors:(processors_StataMP) prapath:(path_eventstudy2_parallel) specifies the number of CPUs that StataMP is suppossed to use in each cluster.

prapath:(path_eventstudy2_parallel) specifies the path to file eventstudy2_parallel.do, which is neccessary to use the parallel computing capabilities of eventstudy2.

arfillevent forces eventstudy2 to fill any missing abnormal returns in the event window with zeros.

arfillestimation forces eventstudy2 to fill any missing abnormal returns in the estimation window with zeros before calculating test statistics. Nevertheless, the benchmark model
will still be estimated based on trade-to-trade returns.

car1LB(CAR_window_1_lower_boundary) to car10LB(CAR_window_10_lower_boundary) specifies the lower boundary of the window over which cumulative (average) abnormal
returns are to be calcuated. It is possible to specifiy up to 10 different windows. The default value is -20. The lower boundaries and upper boundaries (see option car1UB(CAR_window_1_upper_boundary) to
car10UB(CAR_window_10_upper_boundary)) build pairs. For instance, specifying car1LB(-5) and car1UB(3) makes eventstudy2 calculating and reporting cumulative (average) abnormal returns or buy-and hold abnormal returns
for the window [-5;3] relative to the event date.

car1UB(CAR_window_1_upper_boundary) to car10UB(CAR_window_10_upper_boundary) specifies the upper boundary of the window over which cumulative (average)
abnormal returns are to be calculated. It is possible to specifiy up to 10 different windows. The default value is 20.

Examples

Change your current working directory to a path were you can save sample files.

Needs to be run first to set the right download location of sample files:

ssc describe eventstudy2

Download sample files:

net get eventstudy2

use Earnings_surprises.dta

Basic sample event study using raw returns and default parameters:

eventstudy2 Security_id Date using Security_returns if Earnings_surprise > 0.05, returns(Return)

Sample event study using buy-and-hold abnormal returns:

eventstudy2 Security_id Date using Security_returns if Ea > 0.05, ret(Return) car1LB(-1) car1UB(1) car2LB(-5) car2UB(-3) mod(BHAR) marketfile(Factor_returns) mar(MKT) idmar(Market_reference)

Sample event study using the Fama-French multi-factor model:

eventstudy2 Security_id Date using Security_returns if Ea > 0.05, ret(Return) car1LB(-1) car1UB(1) mod(FM) marketfile(Factor_returns) mar(MKT) idmar(Market_reference) factor1(SMB) factor2(HML) risk(risk_free_rate)

Sample event study using the Fama-French multi-factor model with (G)ARCH terms and parallel computing capabilities:

eventstudy2 Security_id Date using Security_returns if Ea > 0.05, ret(Return) mod(FM) marketfile(Factor_returns) mar(MKT) idmar(Market_reference) factor1(SMB) factor2(HML) parallel pclus(2) proc(1) replace garch archo(1) garcho(1) archi(30)

References

Boehmer, E., Musumeci, J, Poulsen, A. B. 1991.
Event-study methodology under conditions of event-induced variance. Journal of Financial Economics 30(2), 253-272.

Brown, S. J., Warner, J. B. 1980.
Measuring security price performance. Journal of Financial Economics 8(3), 205-258.

Corrado, C. J. 1989.
A nonparametric test for abnormal secuity-price performance in event studies. Journal of Financial Economics 23(2), 385-395.

Corrado, C. J., Zivney, T. L. 1992.
The specification and power of of the sign test in event study hypothesis tests using daily stock returns. Journal of Financial & Quantitative Analysis 27(3), 465-478.

Cowan, A. R. 1992.
Nonparametric event study tests. Review of Quantitative Finance and Accounting 2(4), 343-358.

Fama, E. F., French, K. R. 1992.
The Cross-Section of Expected Stock Returns. Journal of Finance 47(2), 427-465.

Fama, E. F., French, K. R. 1993.
Common risk factors in the returns on stocks and bonds. Journal of Financial Economics 33(1), 3-36.

Kolari, J. W., Pynnönen, S. 2010.
Event study testing with cross-sectional correlation of abnormal returns. Review of Financial Studies 23(11), 3996-4025.

Kolari, J. W., Pynnönen, S. 2011.
Nonparametric rank tests for event studies. Journal of Empirical Finance 18(5), 953-971.

Lyon, J.. D., Barber, B. M., Tsai, C.-L. 1999.
Improved methods for tests of long-run abnormal stock returns. Journal of Finance 54(1), 165-201.

Maynes, E., Rumsey, J. 1993.
Conducting event studies with thinly traded stocks. Journal of Banking and Finance 17(1), 145-157.

Patell, J. M. 1976.
Corporate forecasts of earnings per share and stock price behavior: Empirical tests. Journal of Accounting Research 14(2), 246-276.

Serra, A. P. 2002.
Event study tests: A brief survey. Working paper. http://www.fep.up.pt/investigacao/workingpapers/wp117.pdf.

Wilcoxon,F. 1945.
Individual comparisons by ranking methods. Biometrics Bulletin 1(6), 80-83.

Author

Thomas Kaspereit

thomas.kaspereit@uni.lu