2.2.3.6 colmask

Menu Information

Column: Mask Cells by Condition

Brief Information

Mask cells based on condition

Command Line Usage

1. colmask irng:=2 cond:=sd nSD:=2; //Mask the cell values in column 2 which outlie 2SD from the mean

2. colmask irng:=3 cond:=gt val:=0.3; //mask cells in column 3 which is greater than 0.3

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 Range need to be masked.
Condition cond

Input

int

0
Specify under what conditions the input data range should be masked.

Option list:

  • sd:Outliers by Std. Deviation
    Mask the values outlying the standard deviation from mean of the input range.
  • gt:>
    Mask the cell values which are greater than the value specified by val.
  • ge:>=
    Mask the cell values which are greater than or equal to the value specified by val.
  • lt:<
    Mask the cell values which are little than the value specified by val.
  • le:<=
    Mask the cell values which are little than or equal to the value specified by val.
  • eq:=
    Mask the cell values which equal to the value specified by val.
  • iqr:Outliers by IQR
    IQR is interquartile range. When it is selected, calculate the range as [Q1-multiple*IQR, Q3+multiple*IQR], and the data outside above range is outliers. Mask these values.
Multiple of SD/ Multiple of IQR nSD

Input

int

1
This variable is available only when the cond is set to sd or iqr. The number n specified here means that the values outlying n standard deviation(s) from mean will be masked. Origin 2019b added support for non-integers, which can be typed into the combo box in the GUI tool (colmask dialog) or scripted as in the following: colmask nSD:=1.5;

Option list:

  • 1
    Mask the cell values which outlie 1SD from the mean.
  • 2
    Mask the cell values which outlie 2SD from the mean.
  • 3
    Mask the cell values which outlie 3SD from the mean.
  • 4
    Mask the cell values which outlie 4SD from the mean.
  • 5
    Mask the cell values which outlie 5SD from the mean.
  • 6
    Mask the cell values which outlie 6SD from the mean.
Value val

Input

double

<unassigned>
This variable is available only when cond is not set to sd or iqr.
Use Absolute Values to Test abs

Input

int

0
This variable is available only when cond is not set to sd or iqr. It specifies whether to use the absolute values to test the condition.
Keep Existing Mask keep

Input

int

0
This variable specifies whether to keep the existing mask or not.

Description

This function masks the input values which match the condition.

Examples

  1. The following steps will show you a simple example to mask data outlying one standard deviation from the mean of a set of random numbers.
    1. Create a new workbook.
    2. Select Format: Worksheet... to open the Worksheet Properties dialog box. Go to the Size tab and change the Row Number to 10000. Click OK button.
    3. Highlight column A and right click on it. In the fly-out menu, select Fill Column with: Normal Random Numbers to fill the first column with normal random numbers.
    4. With the column still selected, click Column: Mask Cells by Condition... to open the colmask dialog box.
    5. Keep the default settings and click OK to execute. Values that lie outside 1SD are masked in red.
  2. The following scripts will show you how to mask the sunspot numbers outlying 1SD from mean in 256 years sunspot number record.
newbook;
string fn$=system.path.program$+"\Samples\Signal Processing\Average Sunspot.dat";
impasc fname:=fn$;
colmask irng:=2 cond:=sd;

Related X-Functions

wcellmask