2.8.26 rnormalize

Menu Information

Analysis : Mathematics : Normalize Columns

Right click column: Normalize

Brief Information

Normalize a range of XY data

Additional Information

Minimum Origin Version Required: 8.1 SR0

Command Line Usage

1. rnormalize irng:=2:4 method:=min;

2. rnormalize irng:=Col(B) method:=specify val:=7 orng:=<new>;

3. rnormalize irng:=2:4 method:=ref type:=max refcol:=5 orng:=<new>;

4. rnormalize irng:=2:4 method:=cell cell:=1[10] orng:=<new>;

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input irng

Input

Range

<active>
Specify the input columns or range. Note that beginning with Origin 2020b, there is a shortened syntax that follows the form [Book]Sheet!(N1:N2), N1 = the beginning column index and N2 being the ending column index in a contiguous range of columns. More complex strings from non-contiguous data of the form [Book]Sheet!([Book]Sheet!N1:N2,[Book]Sheet!N3:N4) are also possible.
Total Data Info datainfo

Input

Treenode

<unassigned>
This is for displaying the data information in the dialog. When you are using the X-Function by LabTalk, please do not use this variable.
Treat Input as One Composite Dataset composite

Input

int

0
Specify whether to treat selection as one composite dataset. This variable is not available when method is set to specify or cell.
Group group

Input

int

<optional>
Specify column or columns as group info so the normalization will be done for each unique group.
Normalize Methods method

Input

int

1
Method used to normalize

Option list:

  • specify:Divided by a specified value {0}
    Divide the vector by a specified value.
  • range:Normalize to [0, 1] {1}
    Normalize data to the range [0, 1].
  • range100:Normalize to [0, 100] {13}
    Normalize data to the range [0, 100]. (9.0 SR0)
  • customrange:Normalize to [v1, v2] {14}
    Normalize data to the range [v1, v2]. (2022b SR0)
  • snd:Z scores (standardize to N(0, 1)) {2}
    Transform to standard normal distribution.
  • max:Divided by Max {3}
    Divide the vector by the maximum value.
  • min:Divided by Min {4}
    Divide the vector by the minimum value.
  • mean:Divided by Mean {5}
    Divide the vector by the mean.
  • median:Divided by Median {6}
    Divide the vector by the median.
  • sd:Divided by SD {7}
    Divide the vector by the standard deviation.
  • norm:Divided by Norm {8}
    Divide the vector by the Norm.
  • mode:Divided by Mode {9}
    Divide the vector by the mode.
  • sum:Divided by Sum {10}
    Divide the input data input data by the sum.
  • ref:Use Reference Column {11}
    Normalize the input data by matching the statistic specified by the type variable to that of a reference column specified by the refcol variable.
  • cell:Divided by Reference Cell {12}
    Divide the input data using a reference cell specified by the cell variable.
User Defined Value val

Input

double

1.0
This variable is available only when method is set to specify. It specifies the value used to divide the input data.
Reference Column refcol

Input

Column

<optional>
This variable is available only when method is set to ref. It specifies the reference single column.
Normalize to type

Input

int

0
This variable is available only when method is set to ref. It determines which statistical variable in reference column is used as the normalization match. After normalization, the chosen statistical variable of input column will match that of the reference column.

Option list:

  • min:Min
    Normalize the input columns such that the min value of each column matches that of the reference column.
  • max:Max
    Normalize the input columns such that the max value of each column matches that of the reference column.
  • mean:Mean
    Normalize the input columns such that the mean value of each column matches that of the reference column.
  • median:Median
    Normalize the input columns such that the median value of each column matches that of the reference column.
  • sum:Sum
    Normalize the input columns such that the sum of each column matches that of the reference column.
  • range:Range
    Normalize the input columns such that the range of each column matches that of the reference column.
Reference Cell cell

Input

Range

<optional>
This variable is available only when method is set to cell. It specifies the single cell used to divide the input data.
v1 v1

Input

double

0
This variable is available only when method is set to Normalize to [v1, v2] (method:=customrange). It specifies the minimum for range of values v1 to v2.
v2 v2

Input

double

1
This variable is available only when method is set to Normalize to [v1, v2] (method:=customrange). It specifies the maximum for range of values v1 to v2.
Output orng

Output

Range

<new>
Specify the output for the normalized columns.

See the syntax here.

Description

This function adjusts column(s) or part of the column(s) to specific "standard" level. It treats each selected column indepently and normalizes all the columns one by one.

Examples

The following script will show you an example of normalizing two sets of data according to a third dataset.

string fn$=system.path.program$ + "\Samples\Curve Fitting\Exponential Decay.dat "; 
impASC fname:=fn$;
rnormalize irng:=3:4 method:=ref refcol:=2 orng:=<new>;


Algorithm

Suppose V is the V values of input data, and \alpha is a user defined value, the normalized data, V{}' can be calculated as follows:

Divided by a specific value:

V{}'=\frac{V}{\alpha }

Normalize to [0, 1]:

V{}'=\frac{V-V_{min}}{V_{max}-V_{min}}

Normalize to [0, 100]:

V{}'=\frac{100(V-V_{min})}{V_{max}-V_{min}}

Normalize to [v1, v2]:

V{}'=\frac{V-v1}{v2-v1}

Z scores (standardize to N(0, 1)):

V{}'=\frac{V-V_{mean}}{V_{SD}}

Divided by Max:

V{}'=\frac{V}{V_{max}}

Divided by Min:

V{}'=\frac{V}{V_{min}}

Divided by Mean:

V{}'=\frac{V}{V_{mean}}

Divided by Median:

V{}'=\frac{V}{V_{median}}

Divided by Standard Derivation:

V{}'=\frac{V}{V_{SD}}

Divided by Norm:

V{}'=\frac{V}{\left \| V \right \|}

\left \| V \right \|=\sqrt{v_1^2+\cdots +v_n^2}

v_n is the n th V values.

Divided by Mode:

V{}'=\frac{V}{V_{mode}}

Divided by Sum:

V{}'=\frac{V}{V_{sum}}

Related X-Functions

Vnormalize, normalize, Cnormalize