1. Learn
  2. /
  3. Courses
  4. /
  5. Inferential Statistics

Exercise

Contingency Table I

An advertising company is trying out some different ads on different groups, and testing which of the ads the groups prefer.

One ad features a child, one features a college party and one features an office workplace. They show these ads to some students, some parents and some business people, who in turn report which ad they preferred.

The dataframe containing the outcome of your research is saved in your console as data. The rows represent the person groups, the columns represent the type of ad, and the values represent how many individuals from a given group preferred the given ad.

Instructions

100 XP
  • In your console, enter data and examine the contingency table.
  • In your console (or elsewhere if you prefer), calculate the total number of individuals in the sample.
  • In your script, report the total number of individuals in the sample as a numerical value.