z-Scores(standard deviation and mean) in PHP

前端 未结 5 1547
暖寄归人
暖寄归人 2020-12-05 14:47

I am trying to calculate Z-scores using PHP. Essentially, I am looking for the most efficient way to calculate the mean and standard deviation of a data set (PHP array). Any

5条回答
  •  佛祖请我去吃肉
    2020-12-05 15:05

    The topic is pretty old, but actually I guess you can get the substitute of STDEV.P function from Excel easily using the function like below.

    function stdev_p($arr) {
        $arr2 = array();
        $mean = array_sum($arr)/count($arr);
        for ($x = 0; $x 

提交回复
热议问题