All pastes #227773 Raw Edit

Mine

public php v1 · immutable
#227773 ·published 2006-10-29 15:44 UTC
rendered paste body
class Ind_ANOVA {  function Ind_Anova($data) {    $this->create($data);  }  function create($data) {    $this->column = count($data);    foreach ($data as $level => $value) {      foreach ($value as $score) {        $this->n_total += 1;        $this->sumx_total += $score;        $this->sumx2_total += pow($score, 2);        $this->n[$level] += 1;        $this->sumx[$level] += $score;        $this->sumx2[$level] += pow($score, 2);      }    }        $this->ss_total = round($this->sumx2_total - (pow($this->sumx_total, 2) / $this->n_total), 3);        for ($i = 1; $i <= $this->column; $i++) {      $ss_between += pow($this->sumx[$i], 2) / $this->n[$i];    }    $this->ss_between = round($ss_between - pow($this->sumx_total, 2) / $this->n_total, 3);    $this->df_between = $this->column - 1;    $this->df_within = $this->n_total - $this->column;    $this->ss_within = round($this->ss_total - $this->ss_between, 3);    $this->mean_sq_between = round($this->ss_between / $this->df_between, 3);    $this->mean_sq_within = round($this->ss_within / $this->df_within, 3);    $this->f_value = round($this->mean_sq_between / $this->mean_sq_within, 3);        require_once 'statistics/PDL/FDistribution.php';        $F = new FDistribution($this->df_between, $this->df_within);    $this->critical_value = round($F->ICDF(1 - 0.05), 3);    $this->sig = round((1 - $F->CDF($this->f_value)), 3);      }}