You are here

protected function AcquiaLiftLearnReport::getTScore in Acquia Lift Connector 7.2

Does a t-test of the difference between two variations.

Parameters

$nx: The count for the first variation

$ny: The count for the variation to compare against.

$meanx: The mean of the first variation.

$meany: The mean of the variation being compared with.

$varx: The variance of the first variation.

$vary: The variance of the variation being compared with.

Return value

float|int A test statistic for the difference.

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

File

includes/AcquiaLiftLearnReport.inc, line 427

Class

AcquiaLiftLearnReport
Class for Acquia Lift Learn Reports.

Code

protected function getTScore($nx, $ny, $meanx, $meany, $varx, $vary) {
  if ($meanx == 0 || $nx == 0 || $ny == 0) {
    return 0;
  }
  $num = $meanx - $meany;
  $den = sqrt($varx / $nx + $vary / $ny);
  return $den ? $num / $den : 0;
}