utest.pexplore: Explore power as a function of sample sie using a one- or...

Description Usage Arguments Value Examples

Description

ttest.pexplore computes (via simulation) the power of an experiment that will be analyzed using a u test (also called Wilcoxon test) for a range of sample sizes. Rather than taking a theoretical distribution, this function takes empirical data and bootstraps them to calculate the power.

Usage

1
2
3
utest.pexplore(x, y = NULL, lown, topn, r = 10000,
  alternative = c("two.sided", "less", "greater"), mu = NULL,
  alpha = 0.05, plotit = TRUE, conf.level = 0.95)

Arguments

lown

smallest sample size to explore.

topn

largest sample size to explore.

plotit

logical (default=TRUE) value. Function generates a plot when TRUE and returns a data frame otherwise.

Value

The probability of finding p < α with the experiment description.

Examples

1
2
3
utest.pexplore(x=c(0, 5, 10), lown=16, topn=24) # Power for a one-sample u test with n in 16-24. Pilot data consists of three data points.
utest.pexplore(x=c(0, 5, 10), lown=16, topn=24,mu = -5) # Same as above, changing the avarege under the null to -5.
utest.pexplore(x=c(0, 5, 10), lown=16, topn=24, y=c(9, 3, 2, 1)) # Power for a two-sample u test with n=16-24 (per condition) using unbalanced pilot data.

julianje/mcpa documentation built on May 13, 2019, 6:14 p.m.