i am trying to figure out if some code is properly generating the right standard deviation formula. the numbers look slightly too high.
here is the relevant code
sum(answercount) as sum,sum(answeranswercount) as sqrsum,sum(answercount)/sum(count) as avg
sqrt(($line['sqrsum']-($line['sum']*$line['sum']/$line['count']))/($line['count']-1)))
the formula should be
sqrt((sum of the squares of each $line - (sum of all $line(s))*(sum of all $line(s))/ number of $line(s))/number of $line(s)-1))
so does the above code fit with that standard deviation formula? any opinions are appreciated.
--
thanks