Chi-Squared Test for Independence

Is there an association between gender and self-image? The 2003-2004 National Health & Nuitrition Exam Survey (NHANES) asked participants to describe their own self-image regarding weight. The options were Underweight, About Right, and Overweight. Here is the data, separated by gender.

selfImage = matrix(c(116,274,1175,1469,1730,1112),ncol=2,byrow=T)
colnames(selfImage)=c('Female','Male')
rownames(selfImage)=c('Underweight','About Right','Overweight')
selfImage
##             Female Male
## Underweight    116  274
## About Right   1175 1469
## Overweight    1730 1112

You can make either a bar graph or a mosaic plot for this data, and each can be oriented two ways:

par(mfrow=c(2,2))
barplot(selfImage,legend=T)
barplot(t(selfImage),legend=T)
mosaicplot(t(selfImage),color=T,las=1,main="Self-Image vs. Gender")
mosaicplot(selfImage,color=T,las=1,main="Gender vs. Self-Image")

You’ll have to decide which of these plots looks the best.

\(\chi^2\)-Test

In order to test the hypotheses:

  • \(H_0\): Gender and self-image are independent in the population.
  • \(H_A\): Gender and self-image are associated.

We use the R command chisq.test().

chisq.test(selfImage)
## 
##  Pearson's Chi-squared test
## 
## data:  selfImage
## X-squared = 226.58, df = 2, p-value < 2.2e-16

As you can see, the results are very significant, so we can safely conclude that there is a real association between gender and self-image in the population. It appears that women are significantly more likely to view themselves as overweight.