Let us say that you are a hospital administrator. You are very clever and have come up with a system to score the quality of the work done by the physicians at your hospital. To simplify things, lets assume that you only have 3 physicians who work at your hospital. The physician’s scores are as follows:

- Dr.
**A**lbert: 76, 85, 91, 67, 73 - Dr.
**B**urns: 92, 90, 60, 79, 75 - Dr.
**C**ollin: 50, 80, 83, 80, 74

The average score for Dr. Albert is 78.4, for Dr. Burns is 79.2 and for Dr. Collin is 73.4. As the hospital administrator, you want to know whether these differences are due to differences in doctor quality or likely from random chance. If there were only two doctor’s a t-test would suffice, but what tests can you use in the case of multiple doctors?

The solution to this is to run an **ANOVA tes**t. How do we do this? Follow these easy steps.

- Let
*j*be the group number (*j=a, b, c*) and*i*be the number obervation within each group (*i=1, 2,…,5*) - Calculate the mean of each group (μ
_{j}): μ_{a}= 78.4; μ_{b}79.2; μ_{c}= 73.4. - Also calculate the mean of the entire sample. μ=77
- Now calculate the Sum of Squares
*within*each group [SS_{within}= ΣΣ (X_{ij}– μ_{j})^{2}]. This shows how much variation there is for each doctor.- SSa = (76 – 78.4)
^{2}+ (85 – 78.4)^{2}+ (91 – 78.4)^{2}(67 – 78.4)^{2}+ (73.4 – 78.4)^{2}= 367.2 - SSb = 666.8
- SSc = 727.2
- SS
_{within }= SSa + SSb + SSc = 1761.2

- SSa = (76 – 78.4)
- Now calculate the Sum of Squares between each group. [SS
_{between}=Σ n_{j}(μ_{j}– μ)^{2}]. This shows how much variation there is across each of the doctor’s average score.- SS
_{between}= 5*(78.4 -77)^{2}+ 5*(79.2 – 77)^{2}+ 5*(73.4 – 77)^{2}= 98.8

- SS
- The F-statistic is calculated as the mean square (MS) statistic for the between and within sum of squares (SS). How do we go from the SS to the MS? That’s easy, we just divide both by the degrees of freedom.
- MS
_{within}= SS_{within}/(N-J) = SS_{within}/12. This is because there are 15 observations and 3 doctors so 15-3=12. Our answer here is: 1761.2/12 = 146.77 - MS
_{between}= SS_{between}/(J-1) = SS_{within}/2. This is because there are 3 doctors, we have 3-1=2. Our answer here is: 98.8/2 = 49.4.

- MS
- Now we can calculate the F statistic as: F = MS
_{between}/MS_{within}= 49.4/146.77 = .337 - If we look this up on an chart for F-statistics, we see that the probability that all 3 doctors are equally good is .721. Thus, we fail to reject the null that all three doctors are equally good.

**STATA**

Is there an easier way to do this? Yes. If you have Stata, you could just use the score as the dependent variable and have dummy variables for Drs. A, B, an C. The you can run a statistical test that the coefficient estimate for Dr. A = the coefficient estimate for Dr. B = the coefficient estimate for Dr. C. This will give you the same probability that the three doctors are equally skilled that we calculated manually above.

**Other Resources**

Khan Academy has a great description of ANOVA as well.

## Leave a Reply