Scale and center columns in the current H2O frame

Syntax

    _h2oframe scale [columnlist] [, options]

columnlist is a list of column names in the H2O frame; see Specifying a list of columns for more information.

 options                Description
 -----------------------------------------------------------------------------------
 nocenter               do not demean the columns
 noscale                do not scale the columns
 center(numlist)        demean the columns by specified values
 scale(numlist)         scale the columns by specified values
 -----------------------------------------------------------------------------------

Description

_h2oframe scale centers and scales numeric columns in the current H2O frame.

Options

nocenter specifies that columns not be demeaned. By default, every column specified is demeaned by its mean. nocenter may not be specified with center(numlist).

noscale specifies that columns not be scaled. By default, every column specified is scaled by its standard deviation. noscale may not be specified with scale(numlist).

center(numlist) specifies that the columns be demeaned by the list of specified values. The first column listed is demeaned by the first number in numlist, the second column listed is demeaned by the second number in numlist, and so on. The number of values in numlist must be equal to the number of columns specified in columnlist.

By default, each column is demeaned by its mean. center() may not be specified with nocenter.

scale(numlist) specifies that the columns be scaled by the list of specified values. The first column listed is scaled by the first number in numlist, the second column listed is scaled by the second number in numlist, and so on. The number of values in numlist must be equal to the number of columns specified in columnlist.

By default, each column is scaled by its standard deviation. scale() may not be specified with noscale.

Examples

 Setup
     . sysuse auto
     . _h2oframe put, into(auto)
     . _h2oframe change auto

 Center and scale all the columns in the H2O frame
     . _h2oframe scale

 Load the standardized H2O frame to Stata as the current dataset and list its values
     . _h2oframe get auto, clear
     . list

 -----------------------------------------------------------------------------------
 Setup
     . sysuse auto
     . _h2oframe put, into(auto2)
     . _h2oframe change auto2

 Center and scale mpg and price
     . _h2oframe scale mpg price
     . _h2oframe list

 Center, but do not scale, weight
     . _h2oframe scale weight, noscale
     . _h2oframe list