-4

The situation is I have 96 sets of paper, 4 questions on every paper and categorized into 5 categories.Every options consisting marks of 0,1,2,3,4. What's the formula to calculate the Standard Deviation?

|     | 0   | 1   | 2   | 3   | 4   |
|-----|-----|-----|-----|-----|-----|
|  A  | 5   | 42  | 71  | 116 | 150 |
|  B  | 7   | 43  | 94  | 136 | 104 |
|  C  | 0   | 47  | 118 | 175 | 140 |
|  D  | 0   | 13  | 40  | 123 | 112 |
|  E  | 0   | 148 | 183 | 175 | 70  |

Category A consists of 4 questions
Category B consists of 4 questions
Category C consists of 5 questions
Category D consists of 3 questions
Category E consists of 6 questions

For A:

Total: (5*0)+(42*1)+(71*2)+(116*3)+(150*4) = 1132

Avg: (1132/96 sets)/4 questions = 2.94

STDEV: ?

1myb
  • 3,536
  • 12
  • 53
  • 73
  • 2
    May I suggest you post this question on http://stats.stackexchange.com which is dedicated to statistics related questions. While I am sure there are plenty of people on SO that could answer your question, a pure statistics problem is off topic for this Q&A site. – Brent Worden Mar 26 '19 at 12:41
  • There are two kinds of standard deviation: one for the entire population and one for a sample. Which kind do you want? (If not stated, the sample standard deviation is usually meant. And I agree that this is not the proper site for this question, unless you are asking how to calculate using a particular computer language or library.) – Rory Daulton Mar 26 '19 at 13:19
  • Aware that it's not a proper site for the question. I need to know the calculation so i will be able to write the PHP site. I couldn't get an answer from the site mentioned. It's based on sample, because we're calculating based on the portion of questions. – 1myb Mar 26 '19 at 13:33
  • You should have mentioned the PHP connection in your original question, but the connection now is still pretty weak. My final question to you: what work have you done on this subject so far? There are *very many* web sites that explain how to calculate the sample standard deviation. Did you do a web search? Was there something you did not understand in the various web pages? – Rory Daulton Mar 26 '19 at 13:45
  • I'm voting to close this question as off-topic because it is about statistics / mathematics instead of directly about programming / coding / programming tools / software algorithms. – Pang Mar 27 '19 at 06:12
  • I'm voting to close this question as off-topic because it would have been easy to answer with a simple Google query or by opening any elementary statistics text book. – duffymo Mar 27 '19 at 13:02

1 Answers1

1

The variance of a distribution is the average sum of (value - average)^2

Then, the Standard deviation is the square root of the variance.

Here, it would be :

Sum : 5*(0-2.94)^2 + 42*(1-2.94)^2 + 71*(2-2.94)^2 + 116*(3-2.94)^2 + 150*(4-2.94)^2 = 432.9824

Variance : 432.9824 /96/4 = 1.127

STDEV : sqrt(1.127) = 1.06

  • Your formula gives the population standard deviation, but the questioner has now stated that he/she wants the sample standard deviation. – Rory Daulton Mar 26 '19 at 13:45
  • Yeah, I haven't seen this information at the moment I posted. – Florian Ingels Mar 26 '19 at 14:59
  • @FlorianIngels would you please share how to get sample STDEV? Appreciate it! – 1myb Mar 26 '19 at 18:01
  • population STDEV = sqrt ( 1/(#population) Sum(value - population.average)^2 for value in population; whereas sample STDEV = sqrt ( 1/(#sample-1) Sum(value - sample.average)^2 for value in sample. I hope it is clear, it's difficult to write it down without any LaTeX command. Furthermore, I think that @RoryDaulton gave good advice in the other comments : you can find the formulas you need by searching 'sample standard deviation' in Google, the first result is sufficient to your problem (I think). – Florian Ingels Mar 27 '19 at 12:10