plotNullDistribution: Plot permutation p-values distribution

View source: R/plotNullDistribution.R

plotNullDistributionR Documentation

Plot permutation p-values distribution

Description

Create a plot of permutation-based p-values with corresponding specified critical vectors.

Usage

plotNullDistribution(P=NULL,family="simes",alpha = 0.05, 
path = getwd(), name = "plot", delta = 0,
copes=NULL,mask=NULL, alternative = "two.sided", rand = FALSE, B = 1000)

Arguments

P

Matrix of p-values with dimensions m \times B where m is the number of variables and B the number of permutations used instead of the data matrix X. Default to NULL.

family

String character. Name of the family confidence envelope to compute the critical vector from "simes", "aorc", "beta", "higher.criticism", and "power". Default to "simes". If more than one critical vector are considered, it must be a vector.

alpha

Numeric value in '[0,1]'. \alpha level to control the family-wise error rate. Default to 0.05.

path

Character string. Path to save the plot. The path does not must end with /. Default to getwd().

name

Character string. The name of file that will be used to save the plot. Default to "plot".

delta

Numeric value. \delta value. Please see the reference below. Default to 0. If more than one critical vector are considered, delta must be a vector having length equals to the length of the vector specified in family.

copes

List of NIfTI file. The list of copes, i.e., contrasts maps, one for each subject used to compute the statistical tests.

mask

NIfTI file or character string. 3D array of logical values (i.e. TRUE/FALSE in/out of the brain). Alternatively it may be a (character) NIfTI file name. If mask=NULL, it is assumed that none of the voxels have to be excluded.

alternative

Character string. It refers to the alternative hypothesis, must be one of "two.sided" (default), "greater" or "lower".

rand

Boolean value. Default to FALSE. If rand = TRUE, the p-values are computed by rowRanks.

B

Numeric value. Number of permutations, default to 1000.

Value

Save a plot in path with name specified in name describing the p-values null distribution with critical value curve and observed p-values in red.

Author(s)

Angela Andreella

References

Andreella, A., Hemerik, J., Finos, L., Weeda, W., & Goeman, J. (2023). Permutation-based true discovery proportions for functional magnetic resonance imaging cluster analysis. Statistics in Medicine, 42(14), 2311-2340.

Examples

## Not run: 
db <- simulateData(pi0 = 0.8, m = 100, n = 20, rho = 0)
out <- signTest(X = db)
pv <- cbind(out$pv, out$pv_H0)
plotNullDistribution(P = pv)

## End(Not run)


angeella/ARIpermutation documentation built on Sept. 12, 2024, 5:37 p.m.