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 m of observed tests statistics. If rankBased = TRUE, you must provide the first option (matrix of permuted statistical tests).

alternative

character string referring to the alternative hypothesis ("greater", "lower", or "two.sided"). is "two.sided".

rankBased

logical value, TRUE to compute p-values by permutation distribution. Default @TRUE.

permReturn

logical value, TRUE to return the t-tests and p-values permutation distribution. Default @TRUE.

df

numerical value. Degrees of freedom (> 0, maybe non-integer). Default df = Inf

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)

[Package pecora version 0.1.1 Index]