Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mean and STadard Deviation?!!

 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, i have a program that wants me to put integers entered into an array,
thats very easy.

but then it wants me to give the mean, and stadard deviant of that array also, then again not so hard.

but....the formulas a pretty....insane.

like Ex/N thats for the mean....i thought the weird E was for "sum of"...
but if this is true, then that is the same as average.

and the SD is even crazier...if someone could put it into lamens for me it would be great...thx!
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Monk Fox:
...like Ex/N thats for the mean....i thought the weird E was for "sum of"...but if this is true, then that is the same as average.

That's correct. The weird E is an uppercase Sigma, for "sum of." The mean is, in fact, the arithmetic average.
 
Adam Price
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Monk Fox:
ok, i have a program that wants me to put integers entered into an array,
thats very easy.

but then it wants me to give the mean, and stadard deviant of that array also, then again not so hard.

but....the formulas a pretty....insane.

like Ex/N thats for the mean....i thought the weird E was for "sum of"...
but if this is true, then that is the same as average.

and the SD is even crazier...if someone could put it into lamens for me it would be great...thx!


Some Values: 1, 3, 13, 1, 2

Mean - what most people call "average" The sum of the values divided by the number of values. With these values, Mean = 4

Median - Put all the values in order, biggest to smallest. The median is the one in the middle
With these values, Median = 2

Mode - The most common value (If you have a stuffy nose, "The /mode/ common value" Here Mode = 1

Standard Deviation - Attempts to give an indication of how far away from the mean most of the values are. Here is another set of numbers with Mean = 4 : {4, 4, 4, 4} Clearly they do not deviate very much from the mean. The way the SD is calculated is to add up the squares of all of the deviations (amount by which a particular datum varies from the mean), divide by the number of values, then take the square root. The variances are squared so that when they are added up, bigger variances really stand out and so that they are all positive. Essentially, the SD finds some "average" of the amount by which the values deviate from their collective "mean." I don't think the explanation athttp://www.med.umkc.edu/tlwbiostats/variability.html is the best I have ever seen, but it's better than mine, plus it spells out the formula in layman's terms.

The wikipedia article http://en.wikipedia.org/wiki/Standard_deviation is also good reading. In particular, read the paragraph headed "Interpretation and Application."
HTH
[ January 26, 2006: Message edited by: Adam Price ]
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
omg sweet arse....ya'll are the best ya hear....
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose you have 3 numbers: 1, 3, and 8. The mean (m) is (1+3+8)/3 = 4.

Then for standard deviation...

26/n = 26/3 which is about 8.7. And the square root of 8.7 is about 2.95. That's the standard deviation.
 
Adam Price
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by marc weber:
Suppose you have 3 numbers: 1, 3, and 8. The mean (m) is (1+3+8)/3 = 4.

26/n = 26/3 which is about 8.7. And the square root of 8.7 is about 2.95. That's the standard deviation.


Nice, Mark....
Let's try it with my set: 1, 3, 13, 1, 2
Then for standard deviation...

104/n = 104/5 which is 20.8. And the square root of 20.8 is about 4.56. That's the standard deviation. From this we see that although the average number of fish per tank is the same in my aquarium and in Mark's, the standard deviation is greater in mine. If you put exactly enough food for four fish (the average number) in every tank, more would die in my tanks from either starvation or exploding bellies than would die in Mark's tanks.
 
Adam Richards
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Click here for additional resources.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I inherited a spreadsheet where someone computed the average absolute value of the delta from one row to the next. For five rows you'd have four deltas. This looks similar to SD without doing the squaring bit to emphasize the furthest out. Since you guys did so well on the standard deviation question, I wondered if you know the name for this thing he did?

Edit: I found this was used in a report he called "Six Sigma-like". A little different because it's ... wrong.
[ January 27, 2006: Message edited by: Stan James ]
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like Taxicab geometry: en.wikipedia.org/wiki/Norm_(mathematics)
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Stan James:
This looks similar to SD without doing the squaring bit to emphasize the furthest out. Since you guys did so well on the standard deviation question, I wondered if you know the name for this thing he did?[ January 27, 2006: Message edited by: Stan James ]
Variance.
 
Adam Price
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Variance - That was my first thought, also, but it isn't quite right - Variance would include the squaring, just not the square root.

Taxicab math - hmm - I am not seeing the relationship?


Do I understand correctly that you're talking about something like this?


This seems to me like (depending on what the field of application is) either the geometric growth factor, the "rate of change" or the slope of the graph. In my example,
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, that's the algorithm. You didn't have a negative delta in your example to show he used abs(delta) but that's still it. I think he was trying to do six sigma and got sorta close. I ran this side by side with stdev() in Excel just to see how much more sentitive stdev() is to wider variations. Quite a lot.
 
Adam Price
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Stan James:
Yeah, that's the algorithm. You didn't have a negative delta in your example to show he used abs(delta) but that's still it. I think he was trying to do six sigma and got sorta close. I ran this side by side with stdev() in Excel just to see how much more sentitive stdev() is to wider variations. Quite a lot.


Yeah - it would still be the average rate of change (slope of the regression line) - it would just be a less accurate one. This sort of algorithm is used when you want to extrapolate beyond your actual observed data. My numbers float around a little bit, but not much, so we would be pretty confident tat we could make a good prediction at what the value would be at line number 239. If we had had some negative values included, we would would make the same guess, but be less confident that it is right. There are better ways of finding this slope - i.e. http://people.hofstra.edu/faculty/Stefan_Waner/calctopic1/regression.html
[ January 28, 2006: Message edited by: Adam Price ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic