standard: Standardization with double centered and column scaling

View source: R/Basic_functions.r

standardR Documentation

Standardization with double centered and column scaling

Description

Standardization with double centered and column scaling

Usage

standard(data, dif.tol = 0.001, max.iter = 10)

Arguments

data

input matrix with n x px.

dif.tol

the value for the threshold of scaling

max.iter

default value = 10

Value

standardized matrix with n x px.

Examples

spmwm = 3*matrix(rnorm(100000),nrow=100)+1
dim(spmwm)
apply(spmwm,1,mean) # we want these to be 0
apply(spmwm,2,mean) # we want these to be 0
apply(spmwm,2,sd) # we want each of these variances to be 1

spmwm_cp=standard(spmwm)
max(abs(apply(spmwm_cp,1,mean)))
max(abs(apply(spmwm_cp,2,mean)))
max(abs(apply(spmwm_cp,2,sd)-1))

singR documentation built on May 29, 2024, 7:30 a.m.