Math_Stats
[ class tree: Math_Stats ] [ index: Math_Stats ] [ all elements ]

Source for file ex_stats_bigdataset.php

Documentation is available at ex_stats_bigdataset.php

  1. <?php
  2.     //require_once 'Math/Stats.php';
  3.     require_once '../../Stats.php';
  4.  
  5.     $data = array();
  6.     $fp fopen("bigcummulativedata.dat""r");
  7.     while ((list($val$countfgetcsv($fp80)) !== false{
  8.         $data[$val$count;
  9.     }
  10.  
  11.     $s = new Math_Stats();
  12.     $s->setData($dataSTATS_DATA_CUMMULATIVE);
  13.     $stats $s ->calcFull();
  14.     //print_r($stats);
  15.     echo "Using Math_Stats:\n"
  16.         . "mean = {$stats['mean']}\n"
  17.         . "SEmean = {$stats['std_error_of_mean']}\n"
  18.         . "std dev = {$stats['stdev']}\n"
  19.         . "quartile(25)) = {$stats['quartiles'][25]}\n"
  20.         . "median = {$stats['median']}\n"
  21.         . "quartile(75) = {$stats['quartiles'][75]}\n"
  22.         . "min = {$stats['min']}\n"
  23.         . "max = {$stats['max']}\n"
  24.         . "count = {$stats['count']}\n\n"
  25.         . "Using SPSS:\n"
  26.         . "mean = 2.8627\n"
  27.         . "SEmean = 0.0005\n"
  28.         . "std dev = 1.0630\n"
  29.         . "quartile(25) = 2\n"
  30.         . "median = 3\n"
  31.         . "quartile(75) = 4\n"
  32.         . "min = 1\n"
  33.         . "max = 41\n"
  34.         . "count = 4255666\n";
  35.         
  36.   //Name,Mean,SEMean,StDev,Q1,Median,Q3,Min,Max,N
  37.   //SPSS,2.8627,0.0005,1.0630,2,3,4,1,41,4255666
  38. ?>

Documentation generated on Mon, 11 Mar 2019 15:39:17 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.