| Title: | Permutation Conditional Random Tests |
|---|---|
| Description: | It provides functions to perform permutation conditional random one-sample and two-samples t-tests in a multivariate framework. |
| Authors: | Angela Andreella [aut, cre] (Main author, <https://orcid.org/0000-0002-1141-3041>) |
| Maintainer: | Angela Andreella <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.1.2 |
| Built: | 2026-05-27 10:48:43 UTC |
| Source: | https://github.com/cran/pecora |
The library is devoted to permutation-based inferential methods.
The pecora (permutation conditional random) package provides functions to perform the one-sample and two-samples t-tests using permutations/sign-flipping.
The tests comprised are: the one and two samples t-tests.
Angela Andreella.
Maintainer: Angela Andreella. <[email protected]>
For the general framework of univariate and multivariate permutation tests see: Pesarin, F. (2001) Multivariate Permutation Tests with Applications in Biostatistics. Wiley, New York.
X <- matrix(rnorm(100*20), nrow=20) out <- oneSample(X = X) pv <- t2p(Test = out, alternative = "two.sided") X <- matrix(rnorm(100*20), nrow=20) rownames(X) <- c(rep(0, 10), rep(1,10)) out<- twoSamples(X = X) pv <- t2p(Test = out, alternative = "two.sided")X <- matrix(rnorm(100*20), nrow=20) out <- oneSample(X = X) pv <- t2p(Test = out, alternative = "two.sided") X <- matrix(rnorm(100*20), nrow=20) rownames(X) <- c(rep(0, 10), rep(1,10)) out<- twoSamples(X = X) pv <- t2p(Test = out, alternative = "two.sided")
Performs sign-flipped one-sample t-tests.
oneSample(X, B = 1000, seed = 1234, permReturn = TRUE)oneSample(X, B = 1000, seed = 1234, permReturn = TRUE)
X |
data matrix where columns represent the |
B |
numeric value, number of permutations to be performed, including the identity. Default is 1000. |
seed |
numeric value, specify seed. Default is 1234. |
permReturn |
logical value, |
Returns an object matrix:
Matrix with dimensions of permuted one-sample t-tests. The first column is the observed one-sample t-tests.
if permReturn = TRUE otherwise returns:
Vector of observed one-sample t-tests
Angela Andreella
X <- matrix(rnorm(100*20), nrow=20) out <- oneSample(X = X)X <- matrix(rnorm(100*20), nrow=20) out <- oneSample(X = X)
Use permutation distribution of a test statistic to get p-values.
t2p(Test, alternative = "two.sided", rankBased = TRUE, permReturn = TRUE, df = Inf)t2p(Test, alternative = "two.sided", rankBased = TRUE, permReturn = TRUE, df = Inf)
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 ( |
Returns an object matrix:
Matrix with dimensions 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:
Vector of p-values for the observed one-sample t-tests
Angela Andreella
X <- matrix(rnorm(100*20), nrow=20) out <- oneSample(X = X) pv <- t2p(Test = out)X <- matrix(rnorm(100*20), nrow=20) out <- oneSample(X = X) pv <- t2p(Test = out)
Performs two-sample t-tests by permutations.
twoSamples(X, B = 1000, seed = 1234, permReturn = TRUE, label = NULL)twoSamples(X, B = 1000, seed = 1234, permReturn = TRUE, label = NULL)
X |
data matrix where columns represent the |
B |
numeric value, number of permutations to be performed, including the identity. Default is 1000. |
seed |
numeric value, specify seed. Default is 1234. |
permReturn |
logical value, |
label |
by default |
Returns a matrix objects:
Matrix with dimensions of permuted two-samples t-tests. The first column is the observed one-sample t-tests.
if permReturn = TRUE otherwise returns:
Vector of observed two-samples t-tests
Angela Andreella
X <- matrix(rnorm(100*20), nrow=20) rownames(X) <- c(rep(0, 10), rep(1,10)) out<- twoSamples(X = X)X <- matrix(rnorm(100*20), nrow=20) rownames(X) <- c(rep(0, 10), rep(1,10)) out<- twoSamples(X = X)