![]() |
VOOZH | about |
We are quite aware that the Standard deviations are for measuring the spread of the numbers in the datasets. The smaller standard deviations suggest that the deviations in the elements are very small or quite insignificant from the mean values of the data sets & the larger deviations suggest a significant or large spread of the items from their mean values in the data sets.
We can compute standard deviations using Python, we will see that here. In Python 3.x we get enormous libraries for the statistical computations. Python’s statistics is a built-in Python library for descriptive statistics. We can use it if our datasets are not too large or if we cannot simply depend on importing other libraries.
The Pooled Standard Deviation is a weighted average of standard deviations for two or more groups. The individual standard deviations are averaged, with more “weight” given to larger sample sizes.
This is Cohen’s alternative formula here for reference:
SDpooled = √((n1-1).SD12 + (n2-1).SD22)/(n1+n2-2)
where,
For equal-sized samples, it simply becomes,
SDpooled = √(SD12 + SD22)/2
Step for calculation:
Pooled standard deviation = √ (n1-1)sample12 + (n2-1)sample22 / (n1+n2-2)
Note If the samples are empty, StatisticsError will be raised.
Step 1: let us try this with an example :
Output:
Standard Deviation for 1st sample = 1.0 Standard Deviation for 2nd sample = 3.7416573867739413
Step 2: Then, let's calculate the length of the samples using the len function in Python
Output:
sample1 : length = 3 | S.D. = 1.0 sample2 : length = 6 | S.D. = 3.7416573867739413
Step 3: Finally, we calculate the Pooled Standard Deviation by using the formula stated above.
Output:
Pooled Standard Deviation = 3.2071349029490928