I posted three indicators to the library that all carry out various standard deviation calculations. I have just found out that there are two ways to calculate standard deviation – one way when calculating it on populations and another way when calculating it on data samples. I appear to have used the wrong one in the code. The difference is only minor and at the last step of the calculation:
- population version: standard deviation = sqrt(total/(p-1))
- data sample version: standard deviation = sqrt(total/(p))
The difference in the results is very tiny but some may prefer the more correct calculation so rather than ask Nicolas to change all the library posts I will just post modified versions of the indicator ITF files here and add a link in each library posts comments.
JSParticipant
Senior
It is just the other way round:
When you calculate the standard deviation and uses the whole population then divide by N
When using a data sample (part of the whole data) divide by (N-1)
The statistical error (not using all data) tends to reduce the calculated value of the SD, to compensate for this use (N-1) instead of N.
If N is small the statistical error will be very large…!!!
The difference is not at the last step but already begins when you calculate the mean…(you must calculate the mean before you can calculate the SD)
The standard deviation in PRT under Indicators uses the N- deviation which is actually wrong because you always use a data sample (of the whole population) so you must divide by (N-1).