Learn R Programming

EquiTrends (version 1.0.0)

rmsTest_func: An internal function of the RMS Equivalence Testing procedure

Description

This is a supporting function of the rmsEquivTest function. It calculates the placebo coefficients and the RMS of the placebo coefficients. It then calculates the critical value for the test and checks whether the null hypothesis can be rejected, according to Dette & Schumann (2024).

Usage

rmsTest_func(
  data,
  equiv_threshold,
  alpha,
  no_lambda,
  base_period,
  no_periods,
  is_panel_balanced
)

Value

An object of class "rmsEquivTest" containing:

placebo_coefficients

A numeric vector of the estimated placebo coefficients,

rms_placebo_coefs

the root mean squared value of the placebo coefficients,

significance_level

the significance level of the test,

num_individuals

the number of cross-sectional individuals in the data (n),

num_periods

the number of pre-treatment periods in the data (T),

num_observations

the number of observations in the data (N),

base_period

the base period 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

  • rms_critical_value: the critical value at the alpha level,

  • 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.

alpha

The significance level for the test. Must be one of 0.01, 0.025, 0.05, 0.1 or 0.2.

no_lambda

See rmsEquivTest.

base_period

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

no_periods

The number of 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")