standardize: Convert a numeric vector to Z-scores.

View source: R/NCmisc.R

standardizeR Documentation

Convert a numeric vector to Z-scores.

Description

Transform a vector to z scores by subtracting its mean and dividing by its standard deviation

Usage

standardize(X)

Arguments

X

numeric vector to standardize

Value

vector of the same length in standardised form

Author(s)

Nicholas Cooper njcooper@gmx.co.uk

Examples

x1 <- rnorm(10,100,15); x2 <- sample(10)
print(x1) ;  standardize(x1)
print(x2) ;  standardize(x2)

NCmisc documentation built on Oct. 17, 2022, 5:09 p.m.