# finding the standard deviation and mean from frequency table

#### newbiestats

##### New Member
I have a frequency table showing age distribition in Auckland supercity election 2010 and I have in the coloumns I have Age, frequency, percentage, upperbondary, class midpoint, class width, histogram height.
In my age rows I have things such as 20 to under 40, 40 to under 50, 50 to under 60, 60 to under 70, and 70 to under 80.
Now my question is how do I find the mean age and standard deviation age from that frequency table.
I have casio fx-82MS calculator and I switched to sd mode and cleared the memory and I enter the data from upper boundary and I press the M+ button after i enter each of these data's and once I finish I press shift 2(s-var) then select the mean and stadard deviation. But the answer I get is wrong. Can anyone tell me what I'm doing wrong????

#### Dragan

##### Super Moderator
You need to use the class midpoints - not the (class) upper boundary values.

#### newbiestats

##### New Member
I tried entering it from class midpoint but I still get wrong answer. I get 54 for mean and 15.2 for standard deviation. Here is my raw data for class midpoint: 30, 45, 55, 65, 75. The answer is 58.63 years for mean and 14.89 years for standard deviation. But my question here is, how do we get them?

#### Dragan

##### Super Moderator
You should start with the mean. You have given the 5 midpoints. Now, what are the 5 class frequencies?

#### Dason

How do you 'know' what the answer is? Is it reported along with the table or something? You most likely won't be able to get the exact same answer because when the data gets binned you lose quite a bit of information.

Quick example:
Real data: -0.9, .1
mean of actual data = -.4
Which corresponds to the following binned Data:
(-1, 0]: 1
(0, 1] : 1
Mean calculated using binned data: 0

These don't match up but we shouldn't expect that they could possibly perfectly match up.

#### newbiestats

##### New Member
The frequencies are in order: 30, 20, 48, 56, 58

#### Dragan

##### Super Moderator
Okay, so then it is straight-forward to compute the mean:

(30)*(30) + (20)*(45) + (48)*(55) + (56)*(65) + (58)*(75) = 12430

Thus, the mean is:

12430/212 = 58.6321

Do you follow?

#### newbiestats

##### New Member
thanks it worked but the problem is how do i enter them to calculator? thats the problem, when finding standard deviation.

#### Dragan

##### Super Moderator
thanks it worked but the problem is how do i enter them to calculator? thats the problem, when finding standard deviation.
Well, no, that's not the problem, newbiestats. In short, it is obvious that you didn't know how to correctly compute the mean to begin with---set calculator issues aside. Mkay.

#### newbiestats

##### New Member
In my calculator I have to go on sd mode and enter those data's then press M+ and then compute the mean and standard deviation but it doesnt work. I tried putting numbers like this 30;30 and press M+, 20;45 and press M+ and such and to compute the standard deviation and mean age but still didnt work.

#### newbiestats

##### New Member

And here is the picture of frequency table with answer below the tables. I really need help on this.

#### Dason

Which part of the following was giving you trouble?
Okay, so then it is straight-forward to compute the mean:

(30)*(30) + (20)*(45) + (48)*(55) + (56)*(65) + (58)*(75) = 12430

Thus, the mean is:

12430/212 = 58.6321

Do you follow?

#### newbiestats

##### New Member
Which part of the following was giving you trouble?
ok i understand that part, but how do I find the standard deviation?

#### Dason

Do you know how to calculate the standard deviation for a normal set of data?

#### newbiestats

##### New Member
Do you know how to calculate the standard deviation for a normal set of data?
yes I do that in a calculator, by going on sd mode, then entering the data and pressing M+, then pressing the S-var button to find the standard deviation but the problem is I'm getting wrong answer

#### Dason

Ok... that's not what I meant. That's using your calculator mindlessly to get something you're told is the standard deviation. I'm asking if I gave you a set of data and a calculator that could only do addition, subtraction, multiplication, division, squaring, and square roots... could you calculate the standard deviation of the set of data?

To put it another way: You're relying way too much on your calculator. If you take the time to think about what you're actually doing and what you're supposed to be doing you WILL save yourself a lot of time and hassle in the long run. By cheating yourself and just pressing a button on a calculator you clearly don't understand what's actually going on. Learning what happens behind the scenes when you press that button is what you need to know how to do - that's what is important here.

#### newbiestats

##### New Member
Ok... that's not what I meant. That's using your calculator mindlessly to get something you're told is the standard deviation. I'm asking if I gave you a set of data and a calculator that could only do addition, subtraction, multiplication, division, squaring, and square roots... could you calculate the standard deviation of the set of data?

To put it another way: You're relying way too much on your calculator. If you take the time to think about what you're actually doing and what you're supposed to be doing you WILL save yourself a lot of time and hassle in the long run. By cheating yourself and just pressing a button on a calculator you clearly don't understand what's actually going on. Learning what happens behind the scenes when you press that button is what you need to know how to do - that's what is important here.
Thanks, I understand but I am going to do a statistic exam in two weeks time and I need a way to calculate it fast, but I still don't know how to do it manually though.

#### bryangoodrich

##### Probably A Mammal
I think we should step back and explain a little theory here, because newbie doesn't seem to be getting exactly what went on in the mean example.

You should be aware that the mean is simply the sum of each data point divided by the number of points in the data set. Right?

With data from a frequency table, we don't have the exact values. Instead, we know the total count. It is the sum of the frequency in all the bins (= 212). To approximate the values, we take the midpoint of each bin to represent the overall value. For instance, a bin of 30 to 40 with frequency 10 might have values 30, 30, 31, 34, 36, 38, 40, 39, 35, 35. We don't know the details. Instead, we simply say the midpoint is 35 and in our ignorance use that to represent all the values in the bin. Thus, we would have 35 times 10 as the sum of data points from that class.

In the example you provide and the way Dragan showed how to do it, we had: $$frequency_j \times midpoint_j$$, for j different classes. Thus, we were simply calculating the mean as always. So how do we calculate standard deviations? You'll need to create your frequency data set, using the "frequency x midpoint" to generate a frequency-sized data set for each class. That is your input. I'm sure your calculator has some way of doing that work for you, but this is ultimately just arithmetic you should be able to do yourself, without any tools.