| TestStatisticBase | R Documentation |
Base (abstract) class for single-event and multi-event test
statistics. Subclass this to plug a custom test statistic into
calculate_statistics() / run_event_study().
A subclass must implement compute(data_tbl, model):
data_tbl – a single event's rows with an
abnormal_returns column already populated by the fitted model.
model – the fitted ModelBase (or list-mock)
instance for that event; its statistics field carries
sigma, degree_of_freedom, residuals and (since
2026-09-24) n_params.
compute() returns a tibble with the statistic's result columns for
that event; multi-event subclasses (see R/multi_event_test_statistics.R)
aggregate across all events in a group.
confidence_level and confidence_type are validated and
stored at construction (confidence_type must be one of
"two-sided" (default), "less" or "greater"); every
p-value computed anywhere in EventStudy is currently two-sided, so a
non-default confidence_type is accepted but ignored, with one
warning at construction (A10, 2026-09-24).
nameShort code of the test statistic.
confidence_levelThe chosen confidence level.
confidence_typeSide of the test. One of
"two-sided" (default), "less" or
"greater". A10 (2026-09-24): every p-value
computed anywhere in EventStudy is currently
two-sided; a non-default value is validated but
has NO effect on any computed statistic – it is
stored and a one-time warning is emitted at
construction. One-sided p-values are not
implemented.
TestStatisticBase$new()Initializes the test statistic. This includes the confidence level and the type of the test ('less', greater' or 'two-sided')
TestStatisticBase$new(confidence_level = 0.95, confidence_type = "two-sided")
confidence_levelThe confidence level for the confidence band. Must be anumber between 0 and 1.
confidence_typeSide of the test statistic:
"two-sided" (default), "less" or
"greater". Every p-value in EventStudy is
currently two-sided; supplying "less" or
"greater" emits one warning that the value
is stored but ignored by every compute() method.
TestStatisticBase$compute()Computes the test test statistics for a single event.
TestStatisticBase$compute(data_tbl, model)
data_tblThe data for a single event with calculated abnormal returns.
modelThe fitted model that includes the necessary information for calculating the test statistic.
TestStatisticBase$clone()The objects of this class are cloneable with this method.
TestStatisticBase$clone(deep = FALSE)
deepWhether to make a deep clone.
Other eventstudy-statistics:
ARTTest,
BHARTTest,
BMPTest,
CARTTest,
CSectTTest,
CalendarTimePortfolioTest,
GeneralizedSignTest,
KolariPynnonenTest,
MultiEventStatisticsSet,
PatellZTest,
RankTest,
SignTest,
SingleEventStatisticsSet,
StatisticsSetBase,
adjust_p_values(),
bootstrap_test(),
car_by_group(),
car_quantiles(),
cross_sectional_regression(),
model_diagnostics(),
pretrend_test(),
simulate_event_study(),
validate_task()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.