Calculates a p-value for a paired t-test via permutations.
Usage
paired.perm.test(d, n.perm = NULL, pval = TRUE)
Value
If pval=TRUE, the output is a single number: the P-value
testing for the symmetry about 0 of the distribution of the population
from which d was drawn.
If pval=FALSE, the output is a vector of the t statistics from
the permutations. An attributed "tobs" contains the t
statistic with the observed data.
Arguments
d
A numeric vector (of differences).
n.perm
Number of permutations to perform. If NULL, all
possible permutations are considered, and an exact p-value is
calculated.
pval
If TRUE, return just the p-value. If FALSE, return the
actual permutation results (with the observed statistic as an
attribute, "tobs").
Details
This calls the function stats::t.test() to calculate a
t-statistic comparing the mean of d to 0. Permutations
are perfomed to give an exact or approximate conditional p-value.