tool.normalize: Estimate statistical scores based on Gauss distribution

Description Usage Arguments Value Author(s) Examples

View source: R/cle.LS.R

Description

To estimate the both pre-liminary and final p-values, tool.normalize normalizes the given data, x, based on Gaussian distribution defined by prm if it is provided. If prm is not provided tool.normalize utilizes the mean and std dev of x.

Usage

1
tool.normalize(x, prm = NULL, inverse = FALSE)

Arguments

x

data that is aimed to be normalized and produced by a simulation process

prm

normalization will take place according to the specified Gaussian distribution parameters, i.e. mean and std dev. If it is not specified, Gaussian statistics of x will be obtained and utilized

inverse

specifies whether the normalization takes place in reverse order

Value

prm

transformed (normalized) parameters for either enrichment score or p-values

Author(s)

Ville-Petteri Makinen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
set.seed(1)
## let us assume we have a set of simulated enrichment scores and 
## one observed score
x <- rnorm(10) ## obtained from 1st permutation test
obs <- rnorm(1)
## Estimate preliminary P-value:
param <- tool.normalize(x)
z <- tool.normalize(obs, param)
p <- pnorm(z, lower.tail=FALSE)

## Estimate final P-value.
y <- rnorm(10) ## obtained from 2nd permutation test
param <- tool.normalize(c(x, y))
z <- tool.normalize(obs, param)
p <- pnorm(z, lower.tail=FALSE)
p <- max(p, .Machine$double.xmin)

zeynebkurtUCLA/Mergeomics documentation built on May 14, 2019, 1:59 a.m.