The Stochastic Dominance (SD) is the classical way of comparing two
random prospects, using their distribution functions. Almost Stochastic
Dominance (ASD) has also been developed to cover the SD failures due to
the extreme utility functions. This package focuses on classical and heuristic methods
for testing the first and second SD and ASD methods given the probability mass
function (PMF) of the random prospects. The goal is to apply these methods
easily, efficiently, and effectively on real-world datasets. For more
details see Hanoch and Levy (1969)
RSD (R Stochastic Dominance) is designed and developed to calculate
Stochastic Dominance (SD) and Almost Stochastic Dominance (ASD) in general. In
more details, given two probability mass functions (PMF), this package helps with:
Install the released version of RSD from CRAN by:
install.packages("RSD")
Or from GitHub by:
install.packages("pak")
pak::pkg_install("ShayanTohidi/RSD")
RSD provides a function, createStochasticDominance() to create the SD object to be
used in all other functions of this package. This function requires two discrete
distributions. Here, the example data set data_ex will be used for creating
the object:
library(RSD)
outcome1 = data_ex$yield[data_ex$gen == 'B73/PHM49']
outcome2 = data_ex$yield[data_ex$gen == 'LH74/PHN82']
pr = rep(1/29,29)
sd.obj = createStochasticDominance(outcome1, outcome2, pr, pr)
Using this code, we can compare the distributions of the performance (yield) of
two cultivars.
The output of this code snippet, sd.obj contains all information for performing
SD and ASD comparisons. This is the main argument in the other functions of this
package.