ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Public Member Functions | |
__construct ($nan_handling=NAN_HANDLING_REMOVE) | |
Constructor of ilStatistics class. More... | |
setNANHandling ($nan_handling=NAN_HANDLING_REMOVE) | |
Set the handling of elements which are not a number. More... | |
getNANHandling () | |
Get the handling of elements which are not a number. More... | |
setData ($stat_data) | |
Sets the data and checks for invalid values. More... | |
getData () | |
Returns the numeric value array containing the data. More... | |
min () | |
Calculates the minimum value. More... | |
max () | |
Calculates the maximum value. More... | |
count () | |
Calculates number of data values. More... | |
sum_n ($n) | |
Calculates the sum of x_1^n + x_2^n + ... More... | |
sum () | |
Calculates the sum of x_1 + x_2 + ... More... | |
sum2 () | |
Calculates the sum of x_1^2 + x_2^2 + ... More... | |
product_n ($n) | |
Calculates the product of x_1^n * x_2^n * ... More... | |
product ($n) | |
Calculates the product of x_1 * x_2 * ... More... | |
arithmetic_mean () | |
Arithmetic mean of the data values xbar = (1/n)*∑x_i. More... | |
geometric_mean () | |
Geometric mean of the data values geometric_mean = (x_1 * x_2 * ... More... | |
harmonic_mean () | |
Harmonic mean of the data values harmonic_mean = n/(1/x_1 + 1/x_2 + ... More... | |
median () | |
Median of the data values. More... | |
rank ($value) | |
Returns the rank of a given value. More... | |
rank_median () | |
Returns the rank of the median. More... | |
quantile ($n) | |
n-Quantile of the data values More... | |
validate () | |
Validates the numeric data and handles values which are not a number according to the $nan_handling variable. More... | |
Data Fields | |
$nan_handling | |
$stat_data | |
Definition at line 18 of file class.ilStatistics.php.
ilStatistics::__construct | ( | $nan_handling = NAN_HANDLING_REMOVE | ) |
Constructor of ilStatistics class.
public
Definition at line 43 of file class.ilStatistics.php.
References $nan_handling, and array.
ilStatistics::arithmetic_mean | ( | ) |
Arithmetic mean of the data values xbar = (1/n)*∑x_i.
Definition at line 228 of file class.ilStatistics.php.
References count(), and sum().
ilStatistics::count | ( | ) |
Calculates number of data values.
Definition at line 140 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 252 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 272 of file class.ilStatistics.php.
References count(), and min().
ilStatistics::max | ( | ) |
Calculates the maximum value.
Definition at line 124 of file class.ilStatistics.php.
References count().
ilStatistics::median | ( | ) |
Median of the data values.
Definition at line 295 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 216 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 194 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 360 of file class.ilStatistics.php.
ilStatistics::rank | ( | $value | ) |
Returns the rank of a given value.
Definition at line 316 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 338 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 170 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 182 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 152 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 390 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 __construct(), getNANHandling(), and setNANHandling().
ilStatistics::$stat_data |
Definition at line 36 of file class.ilStatistics.php.