Location: PHPKode > scripts > Stat1 > stat1/TestStat1.php
<?
/* 
 * Sample test code for the Statistic and the Linear Least square regression class: Stat1
 * Alain M. Samoun 3/12/00
 */

echo "
<HTML>
<BODY BGCOLOR=\"white\">
<PRE>
";

require("Stat1.php");


/* create two arrays for testing*/


$X= array( 110, 116, 124, 129, 131, 138, 142, 150, 153, 155, 156, 159, 164, 168, 174);

$Y= array( 44, 31,  43,  45,  56,  79,  57,  56,  58,  92,  78,  64,  88,  112, 101);


/* create an instance w/o initialization */
$h = new Stat1;

/* do the calculation and print the results */
$h->create($X,$Y,"Test Stat1");

$h->printStats();


/* access the result arrays directly*/
$result = $h->getStats();
echo "\n\nresult is of type: ".gettype($result)."\n";
while (list($key,$val) = each($result)) {
        echo $key."\t".$val."\n";
}

echo"
</PRE>
</BODY></HTML>"

?>


Return current item: Stat1