Learn R Programming

cape (version 2.0.2)

rz.transform: Normalize a vector using rank normalization

Description

This function normalizes numeric vectors to satisfy the assumptions of linear regression. Rank normalization is used to fit the values in the original vector to a normal distribution with a standard deviation of 1.

Usage

rz.transform(x, jitter = FALSE)

Arguments

x
A numeric vector to be normalized
jitter
A logical value indicating how rank ties should be handled. If FALSE, ties are not broken. If TRUE, a small jitter factor is added to each term to break ties.

See Also

rank

Examples

Run this code
data(obesity.cross)
phenotype <- obesity.cross$pheno[,"glucose"]
norm.pheno <- rz.transform(phenotype)
hist(phenotype, main = "Histogram of Original\nGlucose 
Distribution", xlab = "raw glucose")
hist(norm.pheno, main = "Histogram of Normalized\nGlucose 
Distribution", xlab = "normalized glucose")

Run the code above in your browser using DataLab