calculateQTest function

DixonResults calculateQTest(
  1. List<double> values,
  2. Confidence confidence
)

Returns a DixonResults object representing the result of Q test calculation

Throws a DixonException if 'n' is or got lower than 3 during the calculation

Implementation

DixonResults calculateQTest(List<double> values, Confidence confidence) {
  // Prepares values before calculation
  var filteredValues = values.toSet().toList();
  filteredValues.sort();

  filteredValues.length < 3 && (throw DixonException('n is lower than 3'));
  filteredValues.length > 30 && (throw DixonException('n is greater than 30'));
  return _calculateQTest(
      filteredValues, DixonResults(confidence, filteredValues));
}