ILIAS
Release_4_0_x_branch Revision 61816
|
Public Member Functions | |
ilStatistics ($nan_handling=NAN_HANDLING_REMOVE) | |
Constructor of ilStatistics class. | |
setNANHandling ($nan_handling=NAN_HANDLING_REMOVE) | |
Set the handling of elements which are not a number. | |
getNANHandling () | |
Get the handling of elements which are not a number. | |
setData ($stat_data) | |
Sets the data and checks for invalid values. | |
getData () | |
Returns the numeric value array containing the data. | |
min () | |
Calculates the minimum value. | |
max () | |
Calculates the maximum value. | |
count () | |
Calculates number of data values. | |
sum_n ($n) | |
Calculates the sum of x_1^n + x_2^n + ... | |
sum () | |
Calculates the sum of x_1 + x_2 + ... | |
sum2 () | |
Calculates the sum of x_1^2 + x_2^2 + ... | |
product_n ($n) | |
Calculates the product of x_1^n * x_2^n * ... | |
product ($n) | |
Calculates the product of x_1 * x_2 * ... | |
arithmetic_mean () | |
Arithmetic mean of the data values xbar = (1/n)*∑x_i. | |
geometric_mean () | |
Geometric mean of the data values geometric_mean = (x_1 * x_2 * ... | |
harmonic_mean () | |
Harmonic mean of the data values harmonic_mean = n/(1/x_1 + 1/x_2 + ... | |
median () | |
Median of the data values. | |
rank ($value) | |
Returns the rank of a given value. | |
rank_median () | |
Returns the rank of the median. | |
quantile ($n) | |
n-Quantile of the data values | |
validate () | |
Validates the numeric data and handles values which are not a number according to the $nan_handling variable. |
Data Fields | |
$nan_handling | |
$stat_data |
Definition at line 18 of file class.ilStatistics.php.
ilStatistics::arithmetic_mean | ( | ) |
Arithmetic mean of the data values xbar = (1/n)*∑x_i.
Definition at line 231 of file class.ilStatistics.php.
References count(), and sum().
ilStatistics::count | ( | ) |
Calculates number of data values.
Definition at line 144 of file class.ilStatistics.php.
Referenced by arithmetic_mean(), geometric_mean(), harmonic_mean(), max(), median(), min(), product_n(), quantile(), rank(), rank_median(), and sum_n().
ilStatistics::geometric_mean | ( | ) |
Geometric mean of the data values geometric_mean = (x_1 * x_2 * ...
The geometric mean of a set of positive data is defined as the product of all the members of the set, raised to a power equal to the reciprocal of the number of members.
Definition at line 256 of file class.ilStatistics.php.
References count(), and product().
ilStatistics::getData | ( | ) |
Returns the numeric value array containing the data.
Definition at line 95 of file class.ilStatistics.php.
References $stat_data.
ilStatistics::getNANHandling | ( | ) |
Get the handling of elements which are not a number.
Returns NAN_HANDLING_REMOVE if all elements which are not a number will be removed. Returns NAN_HANDLING_ZERO if all elements which are not a number will be set to zero.
Definition at line 72 of file class.ilStatistics.php.
References $nan_handling.
ilStatistics::harmonic_mean | ( | ) |
Harmonic mean of the data values harmonic_mean = n/(1/x_1 + 1/x_2 + ...
Definition at line 277 of file class.ilStatistics.php.
References count(), and min().
ilStatistics::ilStatistics | ( | $nan_handling = NAN_HANDLING_REMOVE | ) |
Constructor of ilStatistics class.
public
Definition at line 43 of file class.ilStatistics.php.
References $nan_handling.
ilStatistics::max | ( | ) |
Calculates the maximum value.
Definition at line 126 of file class.ilStatistics.php.
References count().
ilStatistics::median | ( | ) |
Median of the data values.
Definition at line 302 of file class.ilStatistics.php.
References count().
ilStatistics::min | ( | ) |
Calculates the minimum value.
Definition at line 107 of file class.ilStatistics.php.
References count().
Referenced by harmonic_mean(), and product_n().
ilStatistics::product | ( | $n | ) |
Calculates the product of x_1 * x_2 * ...
numeric | $n | The exponent |
Definition at line 220 of file class.ilStatistics.php.
References product_n().
Referenced by geometric_mean().
ilStatistics::product_n | ( | $n | ) |
Calculates the product of x_1^n * x_2^n * ...
numeric | $n | The exponent |
Definition at line 196 of file class.ilStatistics.php.
References $n, count(), and min().
Referenced by product().
ilStatistics::quantile | ( | $n | ) |
n-Quantile of the data values
double | $n | A value between 0 an 100 calculating the n-Quantile |
Definition at line 376 of file class.ilStatistics.php.
ilStatistics::rank | ( | $value | ) |
Returns the rank of a given value.
Definition at line 326 of file class.ilStatistics.php.
References count().
ilStatistics::rank_median | ( | ) |
Returns the rank of the median.
This method is different from the rank method because the median could be the arithmetic mean of the two middle values when the data size is even. In this case the median could a value which is not part of the data set.
Definition at line 350 of file class.ilStatistics.php.
References count().
ilStatistics::setData | ( | $stat_data | ) |
Sets the data and checks for invalid values.
array | $stat_data | An array containing the numeric data public |
Definition at line 83 of file class.ilStatistics.php.
References $stat_data, and validate().
ilStatistics::setNANHandling | ( | $nan_handling = NAN_HANDLING_REMOVE | ) |
Set the handling of elements which are not a number.
If set to NAN_HANDLING_REMOVE, all elements which are not a number will be removed, if set to NAN_HANDLING_ZERO, all elements which are not a number will be set to zero.
integer | $nan_handling | A constant defining the handling of elements which are not a number public |
Definition at line 58 of file class.ilStatistics.php.
References $nan_handling.
ilStatistics::sum | ( | ) |
Calculates the sum of x_1 + x_2 + ...
Definition at line 174 of file class.ilStatistics.php.
References sum_n().
Referenced by arithmetic_mean().
ilStatistics::sum2 | ( | ) |
Calculates the sum of x_1^2 + x_2^2 + ...
Definition at line 185 of file class.ilStatistics.php.
References sum_n().
ilStatistics::sum_n | ( | $n | ) |
Calculates the sum of x_1^n + x_2^n + ...
numeric | $n | The exponent |
Definition at line 155 of file class.ilStatistics.php.
Referenced by sum(), and sum2().
ilStatistics::validate | ( | ) |
Validates the numeric data and handles values which are not a number according to the $nan_handling variable.
After validation the data is sorted.
Definition at line 414 of file class.ilStatistics.php.
References $key, $result, NAN_HANDLING_REMOVE, and NAN_HANDLING_ZERO.
Referenced by setData().
ilStatistics::$nan_handling |
Definition at line 28 of file class.ilStatistics.php.
Referenced by getNANHandling(), ilStatistics(), and setNANHandling().
ilStatistics::$stat_data |
Definition at line 36 of file class.ilStatistics.php.