Description Usage Arguments Details Value Note Author(s) References Examples
Performs one-sample and two-sample permutation tests on vectors of data.
1 2 |
x |
A (non-empty) numeric vector of data values. |
y |
An optional numeric vector data values. |
alternative |
A character string specifying the alternative hypothesis, and
must be one of |
mu |
A number indicating the null value of the location parameter (or the difference in location parameters if performing a two-sample test). |
paired |
Logical, indicating whether or not a two-sample test should be paired, and is ignored for a one-sample test. |
all.perms |
Logical. The exact p-value is attempted when |
num.sim |
The upper limit on the number of permutations generated. |
plot |
Logical. If |
stat |
Function, naming the test statistic, such as |
... |
Optional arguments to |
A paired test using data x
and nonNULL y
is
equivalent to a one-sample test using data x-y
.
The output states more details about the permutation test, such as one-sample or two-sample,
and whether or not the p.value
calculated was based on all permutations.
alternative |
Same as the input. |
mu |
Same as the input. |
p.value |
The p-value of the permutation test. |
The formulas computed within perm.test
are based on the textbook by Higgins (2004).
Steven T. Garren, James Madison University, Harrisonburg, Virginia, USA
Higgins, J. J. (2004) Introduction to Modern Nonparametric Statistics.
1 2 3 4 5 6 7 8 9 10 11 |
[1] 1.6013242 1.5846410 -0.5714917 0.3988142 0.5416978 1.3851507
[7] -0.2418826 1.3553764 0.5802484 -0.4113348
[[1]]
[1] "One-sample permutation test was performed."
[[2]]
[1] "p-value was calculated based on all permutations."
$alternative
[1] "two.sided"
$mu
[1] 0
$p.value
[1] 0.078125
[1] 1.5735208 1.5312516 0.4463142 1.2528721 -0.5620620 2.3429980
[7] 0.7756172 1.6497653 0.7889176 0.5107436 0.7542697 1.4606170
[13] 0.4759810
[[1]]
[1] "Unpaired two-sample permutation test was performed."
[[2]]
[1] "p-value was estimated based on 20000 simulations."
$alternative
[1] "two.sided"
$mu
[1] 0
$p.value
[1] 0.2584
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.