Jump to content

Recommended Posts

http://us3.php.net/manual/en/function.stats-standard-deviation.php

 

Warning

 

This function is currently not documented; only its argument list is available.

 

this doesn't work for me, "undefined function", is there something I can do? or another function to use? or do I just need to create my own to use?

Link to comment
https://forums.phpfreaks.com/topic/182518-statistics_stardard_deviation/
Share on other sites

Well after 10 minutes of trying to figure out how to use 'bar x' in the [tex] tag..

 

You can install the math extension, or just create your own standard_deviation function, it's not that hard.. Ex:

 

<?php
function standard_deviation($arr)
{
$bar_x = array_sum($arr) / count($arr);
foreach($arr as $x)
	$dev[] = pow($x - $bar_x, 2);
return sqrt(array_sum($dev) / count($arr));
}

echo standard_deviation(Array(78, 84, 86, 92, 95)); // 6

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.