メイン コンテンツをスキップする

FractileExc - スクリプト関数

FractileExc() finds the value that corresponds to the exclusive fractile (quantile) of the aggregated data in the expression over a number of records as defined by a group by clause.

ヒント: You can use Fractile - スクリプト関数 to calculate the inclusive fractile.

Syntax:  

FractileExc(expr, fraction)

Return data type: numeric

The function returns the value corresponding to the rank as defined by rank = fraction * (N+1) where N is the number of values in expr. If rank is a non-integer number, an interpolation is made between the two closest values.

Arguments:  

Argument Description
expr The expression or field containing the data to use when calculating the fractile.
fraction 計算対象となる分位数 (変位値) に相当する値 (0~1 の範囲内)。

Examples and results:  

アプリにスクリプト例を追加して実行します。その後、結果列に含まれている項目をアプリのシートに追加して結果を表示します。

Example Result

Table1:

crosstable LOAD recno() as ID, * inline [

Observation|Comparison

35|2

40|27

12|38

15|31

21|1

14|19

46|1

10|34

28|3

48|1

16|2

30|3

32|2

48|1

31|2

22|1

12|3

39|29

19|37

25|2 ] (delimiter is '|');

 

Fractile1:

LOAD Type,

FractileExc(Value,0.75) as MyFractile Resident Table1 Group By Type;

 

In a table with the dimensions Type and MyFractile, the results of the FractileExc() calculations in the data load script are:

Type MyFractile

Comparison 28.5

Observation 38