permp(x, nperm, n1, n2, total.nperm=NULL, method="auto", twosided=TRUE)total.nperm is supplied.total.nperm is supplied."exact", "approximate" or "auto".x
nperm) and the number of these that were considered at least as extreme as the observed data (x).total.nperm is the total number of distinct values of the test statistic that are possible.
This is generally equal to the number of possible permutations, unless a two-sided test is conducted with equal sample sizes, in which case total.nperm is half the number of permutations, because the test statistic must then be symmetric in the two groups.
Usually total.nperm is computed automatically from n1 and n2, but can also be supplied directly by the user.
When method="exact", the p-values are computed to full machine precision by summing a series terms.
When method="approximate", an approximation is used that is faster and uses less memory.
If method="auto", the exact calculation is used when total.nperm is less than or equal to 10,000 and the approximation is used otherwise.
x <- 0:5
# Both calls give same results
permp(x=x, nperm=99, n1=6, n2=6)
permp(x=x, nperm=99, total.nperm=462)
Run the code above in your browser using DataLab