pval.perm.corr: Generate P values by multiple permulation tests on all the...

View source: R/Pval_perm_edge.R

pval.perm.corrR Documentation

Generate P values by multiple permulation tests on all the possible edges

Description

This function calculate P values in multiple testing to check associations among any two variables(nodes) in case control studies (biological network) by comparing observed Pearson's correlations with those in permutated samples through nonparametric permutation tests.

Usage

pval.perm.corr(dat, nsim, MatchId = NULL, do.parallel = FALSE,
  no_cores = NULL)

Arguments

dat

The observations of p variables in (matched) case control studies in matrix or dataframe format. The names of the variables must be specified.

nsim

The number of permutations for observations for each variable in the dataset-dat, nsim set to a large number such as 10000

MatchId

A vector representing matched id for cases and controls. If the study doesn't have matching, then set to NULL, if matched studies, MatchId can't contain any missing values

do.parallel

Indicator variable(T-TRUE/F-FALSE) whether useing parallel computing with default value-F,not using parallel computing

no_cores

The number of computing units(cores) for parallel computing with default value-NULL when do.parallel=F,must specify the number is do.parallel=T, if PC or laptop can use the value-detectCores() - 1 or smaller

Value

A vector of p-values for Pearson's correlations between any two variables, with corresponding edge names connecting with '_'

Examples

dat1<-matrix(rnorm(4000),ncol=40,nrow=100)
colnames(dat1)<-paste("Var", as.character(1:40),sep="")
pval.edge<-pval.perm.corr(dat1,nsim=1000,MatchId=NULL,do.parallel=FALSE)


yuy113/wActNet documentation built on Sept. 30, 2024, 5:50 a.m.