ILIAS
Release_3_10_x_branch Revision 61812
|
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 38 of file class.ilStatistics.php.
ilStatistics::arithmetic_mean | ( | ) |
Arithmetic mean of the data values xbar = (1/n)*∑x_i.
Definition at line 251 of file class.ilStatistics.php.
References count(), and sum().
ilStatistics::count | ( | ) |
Calculates number of data values.
Definition at line 164 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 276 of file class.ilStatistics.php.
References count(), and product().
ilStatistics::getData | ( | ) |
Returns the numeric value array containing the data.
Definition at line 115 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 92 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 297 of file class.ilStatistics.php.
References count(), and min().
ilStatistics::ilStatistics | ( | $nan_handling = NAN_HANDLING_REMOVE | ) |
Constructor of ilStatistics class.
public
Definition at line 63 of file class.ilStatistics.php.
References $nan_handling.
ilStatistics::max | ( | ) |
Calculates the maximum value.
Definition at line 146 of file class.ilStatistics.php.
References count().
ilStatistics::median | ( | ) |
Median of the data values.
Definition at line 322 of file class.ilStatistics.php.
References count().
ilStatistics::min | ( | ) |
Calculates the minimum value.
Definition at line 127 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 240 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 216 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 396 of file class.ilStatistics.php.
ilStatistics::rank | ( | $value | ) |
Returns the rank of a given value.
Definition at line 346 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 370 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 103 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 78 of file class.ilStatistics.php.
References $nan_handling.
ilStatistics::sum | ( | ) |
Calculates the sum of x_1 + x_2 + ...
Definition at line 194 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 205 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 175 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 434 of file class.ilStatistics.php.
References $result, NAN_HANDLING_REMOVE, and NAN_HANDLING_ZERO.
Referenced by setData().
ilStatistics::$nan_handling |
Definition at line 48 of file class.ilStatistics.php.
Referenced by getNANHandling(), ilStatistics(), and setNANHandling().
ilStatistics::$stat_data |
Definition at line 56 of file class.ilStatistics.php.