Jump to content

php_joe

Members
  • Posts

    175
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://darkswords.joescuriosityshoppe.com

Profile Information

  • Gender
    Not Telling

php_joe's Achievements

Member

Member (2/5)

0

Reputation

  1. Oh, sorry dzelenika, I didn't see your suggestion before. Your modification fixed the error, thanks!
  2. Thank you , However, that code returns the same value as the one I wrote. I guess the problem is with my spreadsheet's STDEV function. Joe
  3. Hello, I am trying to write a function that will calculate the standard deviation of values in an array. I did search past topics and used them to come up with this script: function standard_deviation($sample){ if(is_array($sample)){ $mean = array_sum($sample) / count($sample); foreach($sample as $key => $num) $devs[$key] = pow($num - $mean, 2); return sqrt(array_sum($devs) / count($devs)); } } It seems to work, but I get different values when I've checked it by using STDEV in OpenOffice, so I think I've made an error somewhere.
×
×
  • 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.