Computes z-score (standardized scores)
zscore(x, n = 0)
x | A vector |
---|---|
n | use n or n-1 in the denominator when computing SD (default 0 for n; use -1 for n = -1) |
A vector
Formula: (x - mean(x)) / SD(x)
Hause Lin
zscore(1:10)#> [1] -1.5666989 -1.2185436 -0.8703883 -0.5222330 -0.1740777 0.1740777 #> [7] 0.5222330 0.8703883 1.2185436 1.5666989zscore(1:10, n = 0) # default n = 0 (SD is computed using n)#> [1] -1.5666989 -1.2185436 -0.8703883 -0.5222330 -0.1740777 0.1740777 #> [7] 0.5222330 0.8703883 1.2185436 1.5666989zscore(1:10, n = -1) # n = -1 (SD is computed using n-1)#> [1] -1.4863011 -1.1560120 -0.8257228 -0.4954337 -0.1651446 0.1651446 #> [7] 0.4954337 0.8257228 1.1560120 1.4863011