Learn R Programming

multiDimBio (version 1.2.5)

ZTrans: A function to convert data into a z-score

Description

This function converts the columns in a data matrix into z-scores. The score is computed by subracting each observation in a column from the column mean and divding by the column standard deviation. Each column is converted independently of the others missing values are ignored in the calculation.

Usage

ZTrans(DATA)

Value

Returns a matrix with the same dimensions as DATA.

Arguments

DATA

A (non-empty) matrix with data values. Columns should be different traits and rows unique observations of those traits

See Also

PercentMax, MeanCent

Examples

Run this code
data(Nuclei)

colMeans(Nuclei, na.rm=TRUE)

Nuclei.ZT<-ZTrans(Nuclei)

colMeans(Nuclei.ZT, na.rm=TRUE)

Run the code above in your browser using DataLab