Tuesday, February 26, 2013

John's Data and a Chi Squared Test

I performed a χ2 test on John's data for the relationship of political affiliation and happiness by state. I first determined the number of states for either political party and their associated happiness. Luckily the number of Republican states to Democratic states are equal (25:25). One decision I was forced to make, in order to keep the math easy was to mark neutral states as sad ones because of the simple conclusion that states that are not happy, must be sad (Though the opposite could also be true, keep reading). Upon looking at their happiness, 6 Republican states were happy and 19 were deemed sad. There were 14 happy Democratic states and only 11 sad ones.

The null hypothesis I decided upon was that there should be an even number of happy and sad states per each political affiliation (12.5:12.5, if you believe in half-states). The observed Republican states deviated 6.5 from their expected value, and observed Democratic states deviated 1.5 from their expected value. The deviations were then squared and divided by the expected values, resulting in 3.38 for Republican states and 0.18 for Democratic states. With only one degree of freedom it was determined that the value for Republican states was significant at a probability of 0.07 and the value for Democratic states was determined to be not significant at a probability of 0.91.

What this would serve to show is that Republican states being unhappy as a result of randomness is not very likely (as determined by this study); however, at a significance level of 5% this would not be an acceptable conclusion (0.07>0.05). For Democratic states, as their results were non significant, there is less to say other than, states affiliated with the Democratic party are relatively average when it comes to happiness and sadness.

Aside: When counting neutral states as happy states the values of the deviation squared divided by the expected values equal: 0.18 for Republican states (the same as Democratic states before) and 1.62 for Democratic states. Respective probabilities are, 0.91 for Republican states and 0.2 for Democratic states. The values are more ambiguous than those values previously calculated, but they may also lead to the conclusion that Democratic states on average may tend to be more happy that Republican states. As a follow up, I would find it interesting if this analysis would produce the same values while weighing the sample by its population (Not very likely).

Source: http://www2.lv.psu.edu/jxm57/irp/chisquar.html

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.