nonparametric_tests {estudy2}R Documentation

Returns the result of given event study nonparametric tests.

Description

Performs main nonparametric tests for each date in the event window and returns a data frame of their statistics and significance.

Usage

nonparametric_tests(list_of_returns, event_start, event_end, all = TRUE,
  tests)

Arguments

list_of_returns

a list of objects of S3 class returns, each element of which is treated as a security.

event_start

an object of Date class giving the first date of the event period.

event_end

an object of Date class giving the last date of the event period.

all

a logical vector of length one indicating whether all tests should be performed. The default value is TRUE.

tests

a list of tests' functions among sign_test, generalized_sign_test, corrado_sign_test, rank_test, modified_rank_test, and wilcoxon_test.

Details

nonparametric_tests performs given tests among sign_test, generalized_sign_test, corrado_sign_test, rank_test, modified_rank_test, wilcoxon_test, and merge result to a single data frame. If all = TRUE (the default value), the function ignores the value of tests.

Value

A data frame of the following columns:

References

See Also

sign_test, generalized_sign_test, corrado_sign_test, rank_test, modified_rank_test, and wilcoxon_test.

Examples

## Not run: 
library("magrittr")
rates_indx <- get_prices_from_tickers("^STOXX50E",
                                      start = as.Date("2000-01-01"),
                                      end = as.Date("2002-01-01"),
                                      quote = "Close",
                                      retclass = "zoo") %>%
    get_rates_from_prices(quote = "Close",
                          multi_day = TRUE,
                          compounding = "continuous")
tickers <- c("ALV.DE", "CS.PA", "G.MI", "HNR1.HA", "HSX.L", "MUV2.DE",
             "RSA.L", "TOP.CO")
nine_eleven_nparam <- get_prices_from_tickers(tickers,
                                              start = as.Date("2000-01-01"),
                                              end = as.Date("2002-01-01"),
                                              quote = "Close",
                                              retclass = "zoo") %>%
    get_rates_from_prices(quote = "Close",
                          multi_day = TRUE,
                          compounding = "continuous") %>%
    apply_market_model(regressor = rates_indx,
                       same_regressor_for_all = TRUE,
                       market_model = "sim",
                       estimation_method = "ols",
                       estimation_start = as.Date("2001-03-26"),
                       estimation_end = as.Date("2001-09-10")) %>%
    nonparametric_tests(event_start = as.Date("2001-09-11"),
                        event_end = as.Date("2001-09-28"))

## End(Not run)
## The result of the code above is equivalent to:
data(securities_returns)
nine_eleven_nparam <- nonparametric_tests(list_of_returns = securities_returns,
                                          event_start = as.Date("2001-09-11"),
                                          event_end = as.Date("2001-09-28"))


[Package estudy2 version 0.9.0 Index]