tool.normalize {Mergeomics} | R Documentation

## Estimate statistical scores based on Gauss distribution

### 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

    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

    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)

[Package Mergeomics version 1.18.0 Index]