- Learning Quantitative Finance with R
- Dr. Param Jeet Prashant Vats
- 165字
- 2021-07-09 19:06:54
Standardization
In statistics, standardization plays a crucial role as we have various attributes for modeling and all of them have different scales. So for comparison purposes, we need to standardize the variables to bring them on the same scale. Centering the values and creating the z
scores is done in R by the scale()
function. It takes the following arguments:
x
: A numeric objectcenter
: IfTRUE
, the object's column means are subtracted from the values in those columns (ignoring NAs); ifFALSE
, centering is not performedscale
: IfTRUE
, the centered column values are pided by the column's standard deviation (when center is alsoTRUE
; otherwise, the root mean square is used); ifFALSE
, scaling is not performed
If we want to center the data of Volume
in our dataset, we just need to execute the following code:
>scale(Sampledata$Volume, center=TRUE, scale=FALSE)
If we want to standardize the data of volume in our dataset, we just need to execute the following code:
>scale(Sampledata$Volume, center=TRUE, scale=TRUE)
推薦閱讀
- Introduction to DevOps with Kubernetes
- 輕松學(xué)Java Web開(kāi)發(fā)
- 自動(dòng)控制原理
- TIBCO Spotfire:A Comprehensive Primer(Second Edition)
- Cloud Analytics with Microsoft Azure
- 返璞歸真:UNIX技術(shù)內(nèi)幕
- Creo Parametric 1.0中文版從入門到精通
- Apache Spark Deep Learning Cookbook
- 網(wǎng)中之我:何明升網(wǎng)絡(luò)社會(huì)論稿
- 運(yùn)動(dòng)控制系統(tǒng)
- 空間機(jī)器人
- Natural Language Processing and Computational Linguistics
- Puppet 3 Beginner’s Guide
- 基于Proteus的PIC單片機(jī)C語(yǔ)言程序設(shè)計(jì)與仿真
- 大型機(jī)系統(tǒng)應(yīng)用基礎(chǔ)