Description Usage Arguments Author(s) Examples
Perform a power analysis of a randomization test
1 2 | mcr_power(generate_data, statistics, group_var, test_trials = 100,
power_trials = 100)
|
generate_data |
a function returning a dataframe matching structure expected by statistics |
statistics |
a list of functions to evaluate data produced by generate_data |
group_var |
a character column name to split the data into groups |
test_trials |
the number of MC trials to be performed per experiment |
power_trials |
the number of experiments to be performed in the power calculation |
kholub
1 2 3 4 5 | gen_data <- function(){ data.frame(x = c(rnorm(50), rnorm(50, 1)), class = rep(c('a', 'b'), each = 50)) }
mcrp <- mcr_power(gen_data, c(mean = function(df){ mean(df[df$class == 'a', 'x']) - mean(df[df$class == 'b', 'x']) },
median = function(df){ median(df[df$class == 'a', 'x']) - median(df[df$class == 'b', 'x']) }),
'class')
mcrp
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.