Description Usage Arguments Value Missing values Weights Author(s) See Also Examples
Normalizes the empirical distribution of a set of samples to a common target distribution.
The average sample distribution is calculated either robustly or not
by utilizing either weightedMedian()
or weighted.mean()
.
A weighted method is used if any of the weights are different from one.
1 2 3 |
X |
a numerical NxK |
robust |
If |
ties |
Should ties in |
weights |
If |
typeOfWeights |
A |
... |
Not used. |
Returns an object of the same shape as the input argument.
Missing values are excluded when estimating the "common" (the baseline).
Values that are NA
remain NA
after normalization.
No new NA
s are introduced.
Currently only channel weights are support due to the way quantile normalization is done. If signal weights are given, channel weights are calculated from these by taking the mean of the signal weights in each channel.
Adopted from Gordon Smyth (http://www.statsci.org/) in 2002 \& 2006. Original code by Ben Bolstad at Statistics Department, University of California. Support for calculating the average sample distribution using (weighted) mean or median was added by Henrik Bengtsson.
median
, weightedMedian
,
mean
() and weighted.mean
.
normalizeQuantileSpline
().
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Simulate three samples with on average 20% missing values
N <- 10000
X <- cbind(rnorm(N, mean=3, sd=1),
rnorm(N, mean=4, sd=2),
rgamma(N, shape=2, rate=1))
X[sample(3*N, size=0.20*3*N)] <- NA
# Normalize quantiles
Xn <- normalizeQuantile(X)
# Plot the data
layout(matrix(1:2, ncol=1))
xlim <- range(X, Xn, na.rm=TRUE);
plotDensity(X, lwd=2, xlim=xlim, main="The three original distributions")
plotDensity(Xn, lwd=2, xlim=xlim, main="The three normalized distributions")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.