Learn R Programming

EquiTrends (version 1.0.0)

meanTest_func: An internal function of the EquiTrends Mean Equivalence Testing procedure

Description

This is a supporting function of the meanEquivTest function. It calculates the placebo coefficients and the absolute value of the mean of the placebo coefficients. It then calculates the critical value and p-values if an equivalence threshold is supplied for the test, according to Dette & Schumann (2024). If equivalence threshold is not supplied, it calculates the minimum equivalence threshold for which the null of non-negligible pre-trend differences can be rejected.

Usage

meanTest_func(
  data,
  equiv_threshold,
  vcov,
  cluster,
  alpha,
  n,
  no_periods,
  base_period,
  is_panel_balanced
)

Value

#' An object of class "meanEquivTest" containing:

placebo_coefficients

A numeric vector of the estimated placebo coefficients,

abs_mean_placebo_coefs

the absolute value of the mean of the placebo coefficients,

var_mean_placebo_coef

the estimated variance of the mean placebo coefficient,

significance_level

the significance level of the test,

num_individuals

the number of cross-sectional individuals in the data,

num_periods

the number of periods in the data,

base_period

the base period in the data,

num_observations

the total number of observations in the data,

equiv_threshold_specified

a logical value indicating whether an equivalence threshold was specified.

is_panel_balanced

a logical value indicating whether the panel data is balanced.

If is.null(equiv_threshold), then additionally minimum_equiv_threshold: the minimum equivalence threshold for which the null hypothesis of non-negligible (based on the equivalence threshold) trend-differnces can be rejected.

if !(is.null(equiv_threshold)), then additionally

  • mean_critical_value: the critical value at the alpha level,

  • p_value: the p-value of the test,

  • reject_null_hypothesis: A logical value indicating whether to reject the null hypothesis,

  • equiv_threshold: the equivalence threshold specified.

Arguments

data

The data.frame object containing the data for the test. Should be of the form what is returned by the EquiTrends_dataconstr function.

equiv_threshold

The equivalence threshold for the test. If NULL, the minimum equivalence threshold for which the null hypothesis can be rejected is calculated.

vcov

The variance-covariance matrix estimator. See meanEquivTest for more information.

cluster

The cluster variable for the cluster-robust variance-covariance matrix estimator. See meanEquivTest for more information.

alpha

The significance level for the test. Only required if no equivalence threshold is supplied.

n

The number of cross-sectional individuals in the data.

no_periods

The number of periods in the data.

base_period

The base period for the test. Must be one of the unique periods in the data.

is_panel_balanced

A logical value indicating whether the panel data is balanced.

References

Dette, H., & Schumann, M. (2024). "Testing for Equivalence of Pre-Trends in Difference-in-Differences Estimation." Journal of Business & Economic Statistics, 1–13. DOI: tools:::Rd_expr_doi("10.1080/07350015.2024.2308121")