Overview

Association: Chi-squared contingency and correlation

Congratulations on making it to the end of the stage 1 Data Analysis in R teaching!

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.