
Contents |
Reduce by Group
Reduce XY data by sub-group statistics according to X's distribution
Minimum Origin Version Required: 8.1 SR0
This feature is for OriginPro only.
1. reducexy iy:=(col(A),col(B)) subgroup:=inc xincr:=0.5 xstats:=min ystats:=min;
2. reducexy iy:=(col(A),col(B)) subgroup:=points points:=8 xstats:=ave ystats:=ave;
| Display Name | Variable Name | I/O and Type | Default Value | Description |
|---|---|---|---|---|
| Input | iy |
Input XYRange | | Specifies the input data range. |
| SubGroup Method | subgroup |
Input int | | Specifies the method to divide the source data into subgroups. Then data points in each group will be merged into a single data point.
Option list:
|
| N | points |
Input int | | This is only available when By Every N Points is selected in SubGroup Method. It specifies a number n. Then every n data points in the input range are merged into one data point. |
| X Increment | xincr |
Input double | | This is only available when By X Increment is selected in SubGroup Method. It specifies a value dx. Then the input data points are divided into several groups using dx so that for any two data points which belong to the same group, the difference in their X values cannot exceed dx. After grouping, each group of data points will be merged into one. |
| Groups | groups |
Input int | | This is only available when By Number of Groups is selected in SubGroup Method. It specifies the number of groups. |
| X Start | start |
Input double | | Specifies the X value to start grouping. |
| X End | end |
Input double | | Specifies the X value to end grouping. |
| Merged X by | xstats |
Input int | | Specifies the way to pick the X value of the output data point, into which a group of data points are merged.
Option list:
|
| Merged Y by | ystats |
Input int | | Specifies the way to pick the Y value of the output data point, into which a group of data points are merged.
Option list:
|
| Output | oy |
Output XYRange | | Specifies the output range.
See the syntax here. |
This X-function allows you to reduce XY data based on X values. The X values are required to be monotonic.
It provides multiple methods to group the data. After being grouped, each group of data points are merged into a single data point. You can specify the way to pick the X and Y values of the output data point.
There is a dataset whose X values are not evenly spaced, and you want to reduce the data according to the X values. The dataset contains 200 data points. If you perform the following steps, you will get 50 of them:
You can also use the following script command to reduce the data points:
reducexy iy:=(1,2) subgroup:=bin bins:=50 xstats:=min ystats:=min;