#if (!isset($a)) $a = 1;
#if (!isset($b)) $b = 2;
#if (!isset($n)) $n = 3;
#if (!isset($m)) $m = 4;
$a = $_POST['a'] ?? null;
$b = $_POST['b'] ?? null;
$n = $_POST['n'] ?? null;
$m = $_POST['m'] ?? null;
$TAILLARD = "tools" . DIRECTORY_SEPARATOR . "taillard";
$FISHER = "tools" . DIRECTORY_SEPARATOR . "fisher";
?>
Statistical Tests for Proportions ComparisonSee Bibliography for more details about this statistical test. Resultsfunction isValidInput($a, $b, $n, $m) { $errors = array(); if (!is_numeric($a) or !is_numeric($n) or !is_numeric($b) or !is_numeric($m)) { echo "Some values are missing or wrong type, please complete datas ! "; return false; } if ($n <= 0) array_push($errors, "[EE] " . "Parameter n" . " must be > 0"); else if ($a > $n or $a < 0) array_push($errors, "[EE] " . "Parameter a" . " must be in [0..n]"); if ($m <= 0) array_push($errors, "[EE] " . "Parameter m" . " must be > 0"); else if ($b > $m or $b < 0) array_push($errors, "[EE] " . "Parameter b" . " must be in [0..m]"); if (count($errors) > 0) { echo "";
foreach ($errors as $error) {
echo $error . " Please fill values above... "; } else if (isValidInput($a, $b, $n, $m)) { system("$TAILLARD " . escapeshellcmd("$a $n $b $m")); print ""; system("$FISHER " . escapeshellcmd("$a $n $b $m")); } ?> Other implementationsTests have also been implemented in C and Java libraries. C provides two little console samples, Java has a console and GUI version of the test. See README files for more details.
BibliographyÉric D. Taillard, Philippe Waelti, Jacques Zuber, "Few statistical tests for proportions comparison", Technical report, HEIG-Vd, 2006. |
||
print ' | '; ?>||