Overview

Association: Chi-squared contingency and correlation

Congratulations on making it to the last week of the stage 1 Data Analysis in R!

Animated gif with pastel lines in the background. The words 'CODE HERO' in bold black text scroll across repeatedly.

Artwork by Horst (2023):

This week you will learn how to test whether there is an association between two categorical variables using the chi-squared contingency test and how to test whether there is an association between two continuous variables using the correlation test.

Learning objectives

The successful student will be able to:

  • Explain the principles of correlation and chi-squared contingency tests
  • Select, appropriately correlation and chi-squared contingency tests
  • Apply and interpret a correlation and chi-squared contingency tests in R
  • Appreciate the difference between statistical significance and biological significance
  • Summarise and illustrate with appropriate R figures test results scientifically

Instructions

  1. Prepare

    1. 📖 Read Association
  2. Workshop

    1. 💻 Test whether there is an association between the heights of sibling pairs.
    2. 💻 Learn about the effect of sample size on correlation
    3. 💻 Apply the Spearman rank correlation test to the heights of sibling pairs.
    4. 💻 Test whether there is an association between blood type and peptic ulcers.
    5. 💻 Repeat iv. using untabulated data.
  3. Consolidate

    1. 💻 Test whether there the proportion of slug colour morphs is the same in two populations.
    2. 💻 Repeat i. using untabulated data.

References

Horst, Allison. 2023. “Data Science Illustrations.” https://allisonhorst.com/allison-horst.