mcr_power: Perform a power analysis of a randomization test

Description Usage Arguments Author(s) Examples

Description

Perform a power analysis of a randomization test

Usage

1
2
mcr_power(generate_data, statistics, group_var, test_trials = 100,
  power_trials = 100)

Arguments

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

Author(s)

kholub

Examples

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

holub008/nymph documentation built on June 4, 2019, 10:47 a.m.