Login   Register  
PHP Classes
elePHPant
Icontem

File: statexample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of yuvarajv  >  Statistics - Percentile, Median  >  statexample.php  >  Download  
File: statexample.php
Role: Example script
Content type: text/plain
Description: Example file which shows the usage
Class: Statistics - Percentile, Median
Get the median and percentile of a set of values
Author: By
Last change:
Date: 2007-12-11 05:30
Size: 460 bytes
 

Contents

Class file image Download
<html><body>
<Center>Test for Percentile</center><br />
<?
    
require_once("Stat.class.php");
    
$stat = new Stat();
    
$data = array(12,34,56);
    echo 
"25th Percentile = ".$stat->percentile($data,25)."<br />";
    echo 
"Median (50th percentile) = ".$stat->median($data)."<br />";
    echo 
"95th Percentile = ".$stat->percentile($data,95)."<br />";
    echo 
"quartile(25th, 50th, 75th percentile) = ".implode(",    "$stat->quartiles($data))."<br />";
?></body></html>