You are here

protected static function AcquiaLiftLearnReport::getDGFree in Acquia Lift Connector 7.2

Calculates the degrees of freedom for comparing 2 variations.

Parameters

$nx: The count of the first variation

$ny: The count of the second variation.

$varx: The variance of the first variation.

$vary: The variance of the second variation.

Return value

int An integer representing the degrees of freedom.

1 call to AcquiaLiftLearnReport::getDGFree()
AcquiaLiftLearnReport::doComparisons in includes/AcquiaLiftLearnReport.inc
Runs a t-test comparing $variation to each of the $other_variations.

File

includes/AcquiaLiftLearnReport.inc, line 450

Class

AcquiaLiftLearnReport
Class for Acquia Lift Learn Reports.

Code

protected static function getDGFree($nx, $ny, $varx, $vary) {
  if ($ny < 2 || $nx < 2) {
    return 0;
  }
  $top = pow($varx / $nx + $vary / $ny, 2);
  $bottom = pow($varx / $nx, 2) / ($nx - 1) + pow($vary / $ny, 2) / ($ny - 1);
  return $bottom ? round($top / $bottom) : 0;
}