Ken Blake, Ph.D.

Comparing the percentages of two variables:
A pivot table and a chi-square test.

Campaign ads can vary in lots of ways. This example looks at two of those ways and illustrates how we might be able to learn whether those two ways are associated with each other.

If you've spent any time watching campaign ads - doing so isn't always entirely voluntary - you probably know that such ads can vary in terms of what they emphasize. For example, some ads may emphasize polishing a candidate's image, while other ads may emphasize the candidate's stand on issues.

You may also have noticed that ads can vary in terms of how they attempt to motivate voters. For example, some ads may attempt to appeal to fears that will scare voters into voting for the candidate, or at least against some opponent of the candidate. Other ads may rely on other motivational strategies.

Johnson and Kaid (2002) set out to learn, among other things, whether these two variables, emphasis (on either image or issues) and persuasion strategy (using a fear appeal, or not using a fear appeal), might be related. For example, perhaps fear appeals are more common in issue ads than in image ads. To investigate that possibility, Johnson and Kaid examined 1,213 presidential campaign ads run between 1952 and 2000. The videos below use their data to illustrate creating a pivot table in Excel, testing the table for a nonrandom relationship, and interpreting both the results of the test and the patterns in the pivot table. Credit for the idea of using the Johnson and Kaid (2002) study to illustrate this statistical technique belongs to Hayes (2005).


An important note: The statistical procedure being described involves producing "expected values." The procedure will become unreliable if more than one in five (20 percent) of the expected values are less than five, or if any of the expected values are less than one. Fortunately, expected counts that low aren't very common. If they appear, you might consider combining the category that produced the low expected counts with another category, if the combined categories would still represent something that makes sense. Omitting categories with low expected counts is another option - again, if doing so results in an analysis that still makes sense.

Another important note: In the video, I use the Excel 2010 name for the chi-square computation function: =chisq.test. Earlier versions of Excel use a different name for the function: =chitest. Use whichever function name is appropriate for your version of Excel. As you may notice, both function names are available in Excel 2010, and both do the same thing. 

Ready to try what you saw in the video? Here's the dataset.


Hayes, A.F. (2005). Statistical methods for communication science. Mahwah, NJ: Lawrence Erlbaum.

Johnson, A. & Kaid, L.L. (2002). Image ads and issue ads in U.S. presidential advertising: Using videostyle to explore stylistic differences in televised from 1952 to 2000. Journal of Communication 52, 281-300.