View source: R/p_wilcox.test.R
p_wilcox.test | R Documentation |
Simulates data given one or two parent distributions and returns a p-value. Can also be used for power analyses related to sign tests.
p_wilcox.test(
n,
d,
n2_n1 = 1,
mu = 0,
type = c("two.sample", "one.sample", "paired"),
exact = NULL,
correct = TRUE,
two.tailed = TRUE,
parent1 = function(n, d) rnorm(n, d, 1),
parent2 = function(n, d) rnorm(n, 0, 1)
)
n |
sample size per group |
d |
effect size passed to |
n2_n1 |
sample size ratio |
mu |
parameter used to form the null hypothesis |
type |
type of analysis to use (two-sample, one-sample, or paired) |
exact |
a logical indicating whether an exact p-value should be computed |
correct |
a logical indicating whether to apply continuity correction in the normal approximation for the p-value |
two.tailed |
logical; use two-tailed test? |
parent1 |
data generation function for first group. Ideally
should have SDs = 1 so that |
parent2 |
same as |
a single p-value
Phil Chalmers rphilip.chalmers@gmail.com
# with normal distributions defaults d is standardized
p_wilcox.test(100, .5)
p_wilcox.test(100, .5, type = 'paired')
p_wilcox.test(100, .5, type = 'one.sample')
# using chi-squared distributions (standardizing to 0-1)
p_wilcox.test(100, .5, type = 'one.sample',
parent1 = function(n, d) rchisq(n, df=10) - 10 + d)
p_wilcox.test(100, .5,
parent1 = function(n, d) (rchisq(n, df=10) - 10)/sqrt(20) + d,
parent2 = function(n, d) (rchisq(n, df=10) - 10)/sqrt(20))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.