Difference between revisions of "Quantile"

From Catglobe Wiki
Jump to: navigation, search
 
Line 1: Line 1:
[[Category:Functions_Used_in_where_Expressions]]
+
{{HelpFiles}}  
{{HelpFiles}}
 
  
====quantile====
+
==== quantile ====
  
Quantiles are points taken at regular intervals from the cumulative distribution function of a random variable. Dividing ordered data into q essentially equal-sized data subsets is the motivation for q-quantiles; the quantiles are the data values marking the boundaries between consecutive subsets. Put another way, the kth q-quantile is the value x such that the probability that a random variables will be less than x is at most k/q and the probability that a random variable will be less than or equal to x is at least k/q. There are q − 1 quantiles, with k an integer satisfying 0 < k < q.
+
Quantiles are points taken at regular intervals from the cumulative distribution function of a random variable. Dividing ordered data into q essentially equal-sized data subsets is the motivation for q-quantiles; the quantiles are the data values marking the boundaries between consecutive subsets. Put another way, the kth q-quantile is the value x such that the probability that a random variables will be less than x is at most k/q and the probability that a random variable will be less than or equal to x is at least k/q. There are q − 1 quantiles, with k an integer satisfying 0 < k < q.  
  
Let N be the number of non-missing values of the sample population, and let x1, x2, ....., xN represent the ordered values of the sample population such that x1 is the smallest value, etc. For the kth q-quantile, let p = k / q.
+
Let N be the number of non-missing values of the sample population, and let x1, x2, ....., xN represent the ordered values of the sample population such that x1 is the smallest value, etc. For the kth q-quantile, let p = k / q.  
  
[[Image:775.gif]]
+
[[Image:775.gif]]  
  
j is the integer part of N.p and g is the fractional part.
+
j is the integer part of N.p and g is the fractional part.  
  
'''Syntax'''
+
'''Syntax'''  
  
quantile(''dcsColumn, q, k'')
+
quantile(''dcsColumn, q, k'')  
  
'''Arguments'''
+
'''Arguments'''  
  
''dcsColumn:''  is a numeric dcs column (column whose data type is Number)
+
''dcsColumn:''  is a numeric dcs column (column whose data type is Number)  
  
''q'': an integer number from 2 – Max Int32.
+
''q'': an integer number from 2 – Max Int32.  
  
''k'': an integer number. (0 < k < q)
+
''k'': an integer number. (0 < k < q)  
  
 
(*)Please note that when q = 100, the algorithm used here will return a value slightly different from what returned by percentile function in Excel.  
 
(*)Please note that when q = 100, the algorithm used here will return a value slightly different from what returned by percentile function in Excel.  
  
'''Example'''
+
'''Example'''
 +
 
 +
''number n = quantile(C1, 100, 25) where C2 == 1; ''
 +
 
 +
''print(n); //return quantile value ''  
  
quantile(C1, 100, 25) where C2 == 1;
+
'''Availability'''
  
'''Availability'''
+
Version 5.2 __NOTOC__ <!-- imported from file: 763.htm-->
  
Version 5.2
+
[[Category:Functions_Used_in_where_Expressions]]
__NOTOC__
 
<!-- imported from file: 763.htm-->
 

Latest revision as of 11:43, 20 December 2011



quantile

Quantiles are points taken at regular intervals from the cumulative distribution function of a random variable. Dividing ordered data into q essentially equal-sized data subsets is the motivation for q-quantiles; the quantiles are the data values marking the boundaries between consecutive subsets. Put another way, the kth q-quantile is the value x such that the probability that a random variables will be less than x is at most k/q and the probability that a random variable will be less than or equal to x is at least k/q. There are q − 1 quantiles, with k an integer satisfying 0 < k < q.

Let N be the number of non-missing values of the sample population, and let x1, x2, ....., xN represent the ordered values of the sample population such that x1 is the smallest value, etc. For the kth q-quantile, let p = k / q.

775.gif

j is the integer part of N.p and g is the fractional part.

Syntax

quantile(dcsColumn, q, k)

Arguments

dcsColumn:  is a numeric dcs column (column whose data type is Number)

q: an integer number from 2 – Max Int32.

k: an integer number. (0 < k < q)

(*)Please note that when q = 100, the algorithm used here will return a value slightly different from what returned by percentile function in Excel.

Example

number n = quantile(C1, 100, 25) where C2 == 1;

print(n); //return quantile value

Availability

Version 5.2