perm.t.test | R Documentation |
Performs paired and two-sample t-tests based on Monte Carlo permutation.
perm.t.test(x, ...)
## Default S3 method:
perm.t.test(
x,
y = NULL,
alternative = c("two.sided", "less", "greater"),
paired = FALSE,
var.equal = FALSE,
conf.level = 0.95,
midp = TRUE,
B = 10000L,
...
)
## S3 method for class 'formula'
perm.t.test(formula, data, ...)
x , y |
vectors of numeric data |
... |
additional arguments passed to or from methods |
alternative |
a character string specifying the alternative hypothesis,
one of |
paired |
logical; if |
var.equal |
logical; if |
conf.level |
confidence level in |
midp |
logical; if |
B |
an integer specifying the number of permutations |
formula |
a formula of the form |
data |
an optional matrix or data frame (or similar: see
|
An object of class power.htest
with the following elements:
statistic |
the value of the t-statistic |
p.value |
the p-value for the test |
method |
a character string indicating what type of t-test was performed |
data.name |
a character string giving the name(s) of the data |
alternative |
a character string describing the alternative hypothesis |
B |
the number of permutations |
conf.int |
the confidence interval for the p-value |
t.test
perm.t.test
from the Deducer package
independence_test
and symmetry_test
from the coin package
paired.perm.test
and perm.test
from the broman package
set.seed(1)
x <- rnorm(10, 0, 0.5)
y <- rnorm(10, 0.5, 1)
dat <- data.frame(value = c(x, y), group = rep(1:2, each = 10))
## two-sample data
t.test(x, y)
## equivalent ways to call perm.t.test for two-sample data
perm.t.test(x, y)
perm.t.test(value ~ group, dat)
## paired data
t.test(x - y)
t.test(x, y, paired = TRUE)
## equivalent ways to call perm.t.test for paired data
perm.t.test(x, y, paired = TRUE)
perm.t.test(value ~ group, dat, paired = TRUE)
perm.t.test(x - y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.