Skip to content

Commit

Permalink
Coherence README file and main function documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
TiesBos committed Aug 23, 2024
1 parent c8d3f1c commit 867354c
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 136 deletions.
29 changes: 17 additions & 12 deletions R/EquiTrends_Main_Functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#' If no \code{vcov} parameter is provided, the function defaults to using the variance-covariance matrix
#' estimated by the \link[plm:plm]{plm::plm()} function.
#'
#' One should note that rows containing \code{NA} values are removed from the panel before the testing procedure is performed.
#'
#' NOTE: Please be aware that including control variables (X) might lead to higher computation times for type = \"Boot\" and type = \"Wild\", due to unconstrained parameters in the optimization problem that estimates the constrained placebo coefficients.
#'
#' @references
Expand All @@ -55,9 +57,9 @@
#' \item{\code{significance_level}: the chosen significance level of the test,}
#' \item{\code{base_period}: the base period used in the testing procedure,}
#' \item{\code{placebo_names}: the names corresponding to the placebo coefficients,}
#' \item{\code{num_individuals}: the number of cross-sectional individuals in the panel,}
#' \item{\code{num_periods}: the number of periods in the panel,}
#' \item{\code{num_observations}: the total number of observations in the panel,}
#' \item{\code{num_individuals}: the number of cross-sectional individuals in the panel used for testing,}
#' \item{\code{num_periods}: the number of periods in the panel used for testing (if the panel is unbalanced, \code{num_periods} indicates the range of time periods across all individuals),}
#' \item{\code{num_observations}: the total number of observations in the panel used for testing,}
#' \item{\code{is_panel_balanced}: a logical value indicating whether the panel is balanced,}
#' \item{\code{equiv_threshold_specified}: a logical value indicating whether an equivalence threshold was specified.}
#' \item{if \code{equiv_threshold_specified = TRUE}, then additionally\itemize{
Expand All @@ -79,9 +81,9 @@
#' \item{\code{base_period}: the base period used in the testing procedure,}
#' \item{\code{placebo_names}: the names corresponding to the placebo coefficients,}
#' \item{\code{equiv_threshold_specified}: a logical value indicating whether an equivalence threshold was specified.}
#' \item{\code{num_individuals}: the number of cross-sectional individuals in the panel,}
#' \item{\code{num_periods}: the number of periods in the panel,}
#' \item{\code{num_observations}: the total number of observations in the panel,}
#' \item{\code{num_individuals}: the number of cross-sectional individuals in the panel used for testing,}
#' \item{\code{num_periods}: the number of pre-treatment periods in the panel used for testing (if the panel is unbalanced, \code{num_periods} represents the range in the number of time periods covered by different individuals),}
#' \item{\code{num_observations}: the total number of observations in the panel used for testing,}
#' \item{\code{is_panel_balanced}: a logical value indicating whether the panel is balanced.}
#' \item{if \code{equiv_threshold_specified = TRUE}, then additionally}\itemize{
#' \item{\code{bootstrap_critical_value}: the by bootstrap found critical value for the equivalence test based on the maximum absolute placebo coefficient,}
Expand Down Expand Up @@ -284,6 +286,8 @@ maxEquivTest <- function(Y, ID, G, period, X = NULL, data = NULL, equiv_threshol
#' }
#' If no \code{vcov} parameter is provided, the function defaults to using the variance-covariance matrix
#' estimated by the \link[plm:plm]{plm::plm()} function.
#'
#' One should note that rows containing \code{NA} values are removed from the panel before the testing procedure is performed.
#'
#' @return
#' An object of class "meanEquivTest" containing:
Expand All @@ -292,9 +296,9 @@ maxEquivTest <- function(Y, ID, G, period, X = NULL, data = NULL, equiv_threshol
#' \item{\code{var_mean_placebo_coef}}{ the estimated variance of the mean placebo coefficient,}
#' \item{\code{significance_level}}{ the significance level of the test,}
#' \item{\code{base_period}}{ the base period used in the testing procedure,}
#' \item{\code{num_individuals}}{ the number of cross-sectional individuals in the panel,}
#' \item{\code{num_periods}}{ the number of periods in the panel,}
#' \item{\code{num_observations}}{ the total number of observations in the panel,}
#' \item{\code{num_individuals}}{ the number of cross-sectional individuals in the panel used for testing,}
#' \item{\code{num_periods}}{ the number of periods in the panel used for testing (if the panel is unbalanced, \code{num_periods} represents the range in the number of time periods covered by different individuals),}
#' \item{\code{num_observations}}{ the total number of observations in the panel used for testing,}
#' \item{\code{is_panel_balanced}}{ a logical value indicating whether the panel is balanced,}
#' \item{\code{equiv_threshold_specified}}{ a logical value indicating whether an equivalence threshold was specified.}
#'
Expand Down Expand Up @@ -438,6 +442,7 @@ meanEquivTest <- function(Y, ID, G, period, X = NULL, data = NULL, equiv_thresho
#' @details
#' \code{no_lambda} determines the proportions lambda/\code{no.lambda} for lambda = 1,...,\code{no_lambda} of the cross-sectional units at which the placebo coefficients are estimated. The placebo coefficients are estimated for each of these proportions and the root mean squared (RMS) of the placebo coefficients is calculated, which are then used to construct the critical value at a significance level of \code{alpha}. See Dette & Schumann (2024, s. 4.2.3.) for more details.
#'
#' One should note that rows containing \code{NA} values are removed from the panel before the testing procedure is performed.
#'
#' @seealso \code{\link[=print.rmsEquivTest]{print.rmsEquivTest}}
#'
Expand All @@ -447,9 +452,9 @@ meanEquivTest <- function(Y, ID, G, period, X = NULL, data = NULL, equiv_thresho
#' \item{\code{rms_placebo_coefs}}{the root mean squared value of the placebo coefficients,}
#' \item{\code{significance_level}}{the significance level of the test,}
#' \item{\code{base_period}}{the base period used in the testing procedure,}
#' \item{\code{num_individuals}}{the number of cross-sectional individuals in the panel,}
#' \item{\code{num_periods}}{the number of pre-treatment periods in the panel,}
#' \item{\code{num_observations}}{the total number of observations in the panel,}
#' \item{\code{num_individuals}}{the number of cross-sectional individuals in the panel used for testing,}
#' \item{\code{num_periods}}{the number of pre-treatment periods in the panel used for testing (if the panel is unbalanced, \code{num_periods} represents the range in the number of time periods covered by different individuals),}
#' \item{\code{num_observations}}{the total number of observations in the panel used for testing,}
#' \item{\code{is_panel_balanced}}{a logical value indicating whether the panel is balanced,}
#' \item{\code{equiv_threshold_specified}}{a logical value indicating whether an equivalence threshold was specified.}
#'
Expand Down
Loading

0 comments on commit 867354c

Please sign in to comment.