—
title: “Contingency table analysis”
author: “Your name”
output: word_document
—
“`{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
“`
## Yawning contagion
Yawning is contagious. When we see someone yawn, we are very likely to yawn ourselves. In one study, each participant was shown one of several pictures, including a picture of a man yawning, the same man smiling, and a yawning man with his mouth covered. Participants yawned much more when shown the yawner than the smiler. Surprisingly, an identical number also yawned when shown the picture with the mouth obscured. This suggests that something else, perhaps the eyes, is an important trigger of yawning. To test this, researchers counted the number of yawners and non-yawners among participants shown a picture of a yawning man with his eyes covered. They similarly counted the number of yawners and non-yawners among participants shown a picture of a yawning man with his eyes visible. The data are given in the file “yawn.csv”.
Read the data into R and convert them to a table. [3 pts]
“`{r}
“`
Make a mosaic plot of the results. [4 pts]
“`{r}
“`
Does the plot show any evidence of an association between eye visibility and yawning contagion? Briefly explain your answer. [2 pts]
Test for an association between eye visibility and yawning contagion. Do this test “by hand” in R. [10 pts]
“`{r}
“`
Repeat the test using an appropriate R function. [2 pts]
“`{r}
“`
State the conclusion of the test, with full statistical details. [3 pts]
## Vampire bats
Vampire bats feed almost exclusively on blood. A bat must feed every day or it will starve to death, but bats do not always succeed in finding a meal. Perhaps for this reason, they roost in communal groups and sometimes share blood by regurgitative feeding. Researchers measured whether hungry bats were more likely to receive regurgitated blood than were partially fed bats. Eight bats were captured in the evening before they had fed and were held without feeding until the next morning. As a control, seven bats were captured after naturally feeding. They were also held until the following morning. At that time, all the bats were returned to their groups. Six of the eight hungry bats were given regurgitated blood meals by group-mates, but only one of the seven well-fed bats were given a blood meal by other bats. Use an appropriate R function to test whether the probability of being fed by roost-mates varies according to hunger status. [12 pts]
“`{r}
“`
Explain your choice of test. [2 pts]
State the conclusion of the test, with full statistical details. [2 pts]