so_stodom {stodom} | R Documentation |
second-order stochastic dominance test
Description
This function tests for second-order stochastic dominance.
Usage
so_stodom(data_1, data_2, bins_size, n_draws, useed, variable_1, variable_2, type)
Arguments
data_1 |
data 1. |
data_2 |
data 2. |
bins_size |
bin size. |
n_draws |
number of draws to compute p values (default = 500). |
useed |
user defined seed |
variable_1 |
name of a (as a string); only for the output table (default = "a"). |
variable_2 |
name of b (as a string); only for the output table (default = "b"). |
type |
type of bootstrapped test, bootstrapping 1 and 2 of Barrett and Donald (2003) are available (default = "boot2"). |
Details
This function computes the consistent test of second-order stochastic dominance following Barrett and Donald (2003). In detail, this function estimate their Kolmogorov-Smirnov type tests based on bootstrapping 2. The function was implemented as part of Schaub xxx
Value
The function returns a list object containing the p-values of two dominance tests (i.e., variable 1 vs. variable 1 and variable 2 vs. variable 1).
References
Barrett, G. F., & Donald, S. G. (2003). Consistent tests for stochastic dominance. Econometrica, 71(1), 71-104.
Schaub, S. & El Benni, N. (2024). How do price (risk) changes influence farmers’ preference to reduce fertilizer application?
Examples
# load stodom
require(stodom)
data_a <- rnorm(500, 3, 2)
data_b <- rnorm(500, 1, 2)
# estimate second-order stochastic dominance
so_stodom(data_1 = data_a, data_2 = data_b, n_draws = 100, useed = 1, bins_size = 1)