I wonder, if there is a library for statistical tests like
I found a pecl extension: http://php.net/manual/de/book.stats.php , which gives some basic parameters, but no tests found yet
If you want a full PHP library you can have a look here, but I don't know if it is something really good.
This statistical test is quite gready and I don't know if php is a good choice to compute it. As proposed in the comments, you should write your script in R language and then call it. There are two ways to call another language depending on your server architecture. Assuming you will have only one server, you can use proc_open :
$descriptorspec = array(
0 => array("pipe", "r"), //a pipe where you will read
1 => array("pipe", "w"), //std out : a pipe where you will write
2 => array("file", "/tmp/error-output.txt", "a") // stderr : a log file, not mandatory here
);
$pipes = array();
$process = proc_open('R yourfile.r',$decriptorspec,$pipes);
fwrite($pipes[0],$yourStatsToBeCompute);
$result = stream_get_contents($pipes[1]);
fclose($pipes[0]);
fclose($pipes[1]);
proc_close($process);
You can also use cURL to contact a Rscript on another server with RCurl.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With