Skip to contents

Column-wise (x - mean) / sd. ddof = 0 is numpy's default POPULATION sd, which is not R's sd(); pass ddof = 1 for the n-1 form.

Usage

morie_geron_standardization(X, ddof = 0)

Arguments

X

Numeric vector or matrix.

ddof

Degrees of freedom.

Value

List with X_std, Z, mean, scale, ddof, estimate, n.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_standardization(V)
#> $X_std
#>            [,1]
#> [1,] -1.5275252
#> [2,] -1.0910895
#> [3,] -0.6546537
#> [4,] -0.2182179
#> [5,]  0.2182179
#> [6,]  0.6546537
#> [7,]  1.0910895
#> [8,]  1.5275252
#> 
#> $Z
#>            [,1]
#> [1,] -1.5275252
#> [2,] -1.0910895
#> [3,] -0.6546537
#> [4,] -0.2182179
#> [5,]  0.2182179
#> [6,]  0.6546537
#> [7,]  1.0910895
#> [8,]  1.5275252
#> 
#> $mean
#> [1] 4.5
#> 
#> $scale
#> [1] 2.291288
#> 
#> $ddof
#> [1] 0
#> 
#> $estimate
#> [1] 1.527525
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Column-wise z-score with ddof=0"
#>