Grouped Data Mean and Standard Deviation Calculator

[This article was first published on finnstats », and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Story 477922585

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 »

RangeFrequency
1-204
21-408
41-606
61-802
81-1009

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.

RangeFrequencyMidpointMidPoint*Frequency
1-20410.542
21-40830.5244
41-60650.5303
61-80270.5141
81-100990.5814.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 »

RangeFrequencyMidpointMidpoint*FreqMeanMidpoint-Mean(Midpoint-Mean)*(Midpoint-Mean)Frequency[(Midpoint-Mean)(Midpoint-Mean)]
1-20410.542 53.266.542.25169
21-40830.5244 53.26 22.5506.254050
41-60650.5303 53.26 44.51980.2511881.5
61-80270.5141 53.26 68.54692.259384.5
81-100990.5814.5 53.26 81.56642.2559780.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!

The post Grouped Data Mean and Standard Deviation Calculator appeared first on finnstats.

To leave a comment for the author, please follow the link and comment on their blog: 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.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)