Login   Register  
PHP Classes
elePHPant
Icontem

File: testDrive.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Alejandro Mitrou  >  PHP Spearman Rank Correlation  >  testDrive.php  >  Download  
File: testDrive.php
Role: Example script
Content type: text/plain
Description: Class usage samples.
Class: PHP Spearman Rank Correlation
Compute the Spearman Correlation and draw results
Author: By
Last change:
Date: 1 year ago
Size: 875 bytes
 

Contents

Class file image Download
<?php
  
include('SpearmanCorrelation.php');
  
$data0 = array(126777716666666);
  
$data1 = array(0.511.522.533.544.555.5616.518.819.9);
  
$data2 = array(123456789101112131415);
  
$data3 = array(3333338910111213141516);
  
$data4 = array(547368111210913100141516);
  
$matrix = array();
  
array_push($matrix$data0$data1$data2$data3);

  
$sp = new SpearmanCorrelation();
  
#Correlation coefficient between two arrays
  
$result $sp->test($data4$data3);
  
$sp->drawResults();
  
  
#Finding correlation within a matrix
  
$result $sp->testMatrix($matrix);
  
  
#Displays resulting coefficient matrix
  
$sp->drawResults();
  
#As previous one, focusing on correlated variables
  
$sp->drawResults(0.8TRUE);
?>