Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
We want to determine the mean and standard deviation of ungrouped data in practically all circumstances. However, how can you do that with grouped data?
Grouped Data Mean and Standard Deviation
Let’s look at an example of how to compute mean and SD.
How to Calculate Root Mean Square Error (RMSE) in R »
Range | Frequency |
1-20 | 4 |
21-40 | 8 |
41-60 | 6 |
61-80 | 2 |
81-100 | 9 |
Grouped Data Mean
The formula for grouped mean is
Mean: Σmini / N
where:
mi: Midpoint of the ith group
ni: Frequency of the ith group
N: Total sample size
The midpoint is determined by averaging the range’s bottom and upper values.
Range | Frequency | Midpoint | MidPoint*Frequency |
1-20 | 4 | 10.5 | 42 |
21-40 | 8 | 30.5 | 244 |
41-60 | 6 | 50.5 | 303 |
61-80 | 2 | 70.5 | 141 |
81-100 | 9 | 90.5 | 814.5 |
Mean=(42+244+303+141+814.5)/29=53.26
Grouped data set mean is 53.26.
Grouped Data Standard Deviation
Let’s look at the formula for computing the standard deviation of grouped data.
How to Calculate Mean Absolute Percentage Error (MAPE) in R »
Range | Frequency | Midpoint | Midpoint*Freq | Mean | Midpoint-Mean | (Midpoint-Mean)*(Midpoint-Mean) | Frequency[(Midpoint-Mean)(Midpoint-Mean)] |
1-20 | 4 | 10.5 | 42 | 53.26 | 6.5 | 42.25 | 169 |
21-40 | 8 | 30.5 | 244 | 53.26 | 22.5 | 506.25 | 4050 |
41-60 | 6 | 50.5 | 303 | 53.26 | 44.5 | 1980.25 | 11881.5 |
61-80 | 2 | 70.5 | 141 | 53.26 | 68.5 | 4692.25 | 9384.5 |
81-100 | 9 | 90.5 | 814.5 | 53.26 | 81.5 | 6642.25 | 59780.25 |
Standard Deviation: Sqrt(Σni(mi-μ)2 / (N-1))
where:
ni: Frequency of the ith group
mi: Midpoint of the ith group
μ: Average value
N: Total sample size
Let’s execute the formula.
Standard Deviation=sqrt(169+4050+11881.5+9384.5+59780.25)/28=55.18
Grouped data standard is 55.18.
Plot Differences in Two Measurements-Bland-Altman Plot in R »
Subscribe to the Newsletter and COMMENT below!
< !-- /wp:paragraph --> < !-- wp:paragraph -->
The post Grouped Data Mean and Standard Deviation Calculator appeared first on finnstats.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.