t2p {pecora} | R Documentation |
From t-tests to p-values
Description
Use permutation distribution of a test statistic to get p-values.
Usage
t2p(Test, alternative = "two.sided", rankBased = TRUE, permReturn = TRUE, df = Inf)
Arguments
Test |
can be a matrix or a vector.
In the first case the columns represent the B permutations and rows the m tests statistic.
The observed test statistic is in the first column
and the permutation distribution in the remaining columns.
In the second case, it is a vector of length |
alternative |
character string referring to the alternative hypothesis ( |
rankBased |
logical value, |
permReturn |
logical value, |
df |
numerical value. Degrees of freedom ( |
Value
Returns an object matrix:
- pv
Matrix with dimensions
m x B
of permuted one-sample p-values. The first column is the p-values for the observed one-sample t-tests.
if permReturn = TRUE
otherwise returns:
- pv
Vector of
m
p-values for the observed one-sample t-tests
Author(s)
Angela Andreella
Examples
X <- matrix(rnorm(100*20), nrow=20)
out <- oneSample(X = X)
pv <- t2p(Test = out)