Learn R Programming

CAISEr (version 0.3.3)

calc_ropt: Calculates the optimal ratio of sample sizes

Description

Calculates the optimal ratio of sample sizes of two algorithms on a given instance, for either simple or percent differences, using the parametric approach.

Usage

calc_ropt(x1, x2, dif)

Arguments

x1

vector of observations

x2

vector of observations

dif

name of the difference for which the SE is desired. Accepts "perc" (for percent differences) or "simple" (for simple differences)

Value

numeric value: optimal ratio n1 / n2

References

  • F. Campelo, F. Takahashi: Sample size estimation for power and accuracy in the experimental comparison of algorithms (submitted, 2017).

Examples

Run this code
# NOT RUN {
set.seed(1234)
x1 <- rnorm(25, 5, 1)
x2 <- runif(35, 8, 10)
calc_ropt(x1, x2, "simple")
calc_ropt(x1, x2, "perc")
# }

Run the code above in your browser using DataLab