6. Week 6 - Chi-Square
Written by Margriet Groen
This week we focus on two strands of learning:
- Chi-square as a measure of association between categorical variables
- Research project: Refine research question, decide on measures, pre-register hypothesis
So far, we’ve looked at measures of association between variables at the ordinal, interval or ratio level ((Spearman’ss rho or Pearson’s r). This week you will learn about a measure that can be used to measure an association between categorical variables.
We will also start the group project in which you will investigate the question: Is mind wandering related to screen time?
The materials we have prepared to support your learning are arranged in four parts:
- Lectures
- Reading
- Pre-lab activities
- Lab activities
You can navigate to each in the side bar on the right
Lectures
A. Theory - Associations between categorical variables (~23 min) Watch this part before you complete the reading and the pre-lab activities. The video has captions, in case you find that helpful. You can download the slides and a transcript from the links below the video.
Associations between categorical variables - slides Associations between categorical variables - transcript
B. The mini research project (~9 minutes) If you haven’t already, make sure you watch the overview video on the mini research project on the project page here.
Reading
All reading is accessible via the library. You can go to Moodle -> Library Resources -> Resource List or you can follow this link. Readings have one of the following tags:
- Essential: We expect you to be familiar with these reading. You will be assessed on this.
- Recommended: We highly recommend these readings. They often provide a different perspective, or explain things in a different way.
- Optional: Further readings for those interested.
The reading list is divided into multiple sections:
- Reading associated with statistics: this contains links to readings useful for the development of statistical concepts and skills. The main textbook Fundamental statistics for the behavioral sciences by Howell (Essential) lives here.
- Reading associated with psychological research principles and design: this contains links to readings that provide a good basis for foundational knowledge around research design.
- Reading associated with Open Science principles and practices: this contains links to key literature on the Open Science movement.
- Week by week: these contain links to key reading for that week that are not listed on any of the more general lists above.
For week 6, the reading is:
Howell, D. C. (2017). Fundamental statistics for the behavioral sciences (9th ed.). Cengage Learning. Chapter 19. Essential
Key readings for the mini research project as outlined here.
Please note that I might mention an alternative textbook in the lectures. The content is highly similar, but this year, we’ve decided to use Howell (2017) as the core text. So no need to look at the book by Greene & D’Oliveira (2006).
Pre-lab activities
After having watched the lectures and read the textbook chapter you’ll be in a good position to try these activities. Completing them before you attend your lab session will help you to consolidate your learning and help move through the lab activities more smoothly.
Pre-lab activity 1: Refine the research question.
Each group will investigate the following question: Is mind wandering related to screen time? Each group will refine this research question and decide:
- What aspect of mind wandering to focus on and how to measure it
- What aspect of screen time to focus on and how to measure it
Please read the key readings (more info on the project page here) before the lab session. In your group, you will discuss your ideas about mind wandering and screen time, how to refine the research question, and how to measure each construct.
Pre-lab activity 2: Calculating Chi-square by hand and interpreting the results
Is there a relationship between the number of people who smoke and the number of people who drink? Please note that the question is the number of people (frequency) and not how much people drink/smoke. Also note that these are fictitious data. You’ll need a table of critical values for Chi-square. This can be found here, and also in the zip-folder you’ll be asked to download in the a later pre-lab activity.

Pre-lab activity questions:
- Complete the Pearson’s Chi-square test by hand using the data above and fill in the blanks:
\(\chi 2\) ( , N = ) = , p
- Can you reject the null hypothesis?
Pre-lab activity 3: Data visualisation - Creating a bar chart
We’ve been using the ggplot2 package for visualising data. You can read a great overview of the ggplot2 package here. It also links to a ‘cheatsheet’ that you can download as a .pdf document. Lots of useful info on there!
With regard to visualising relations between categorical variables, the geom_bar() function is important. The following ‘recipe’ summarises what it does and how to use it.
geom_bar() - create a bar chart - recipe
Have a look at the ‘recipe’ and read through it. Try to understand each step. Going through the example is particularly helpful.
Each ‘recipe’ has the same structure. As an example, let’s have a look at one ( recipe) for a function that you have used each week: read_csv()
- First, it summarises what it is that you want to achieve when using that specific function. In the case of
read_csv()it says “You want to read a CSV file into your R session, where you can manipulate its contents. The file has the extension .csv. A CSV file is a text file that contains a table whose values are separated by commas, i.e. a Comma Separated Values file.” - Then, it outlines a number of steps that you need to carry out when using this function. For
read_csv()it outlines 3 steps: 1. Call the function. 2. Give the filepath to your file as a character string. 3. Save teh output to an object. - Finally, there is an example talks you through using the function with some data. For
read_csv()it uses an example with data about chickens. - Additional information appears in extra boxes with a light-bulb icon. If you find those confusing, don’t worry about them at this stage.
Pre-lab activity 4: Getting ready
More information and the download links will be shared as soon as possible.
Lab activities
Information about the lab activities will be added as soon as possible
Answers
Answers to the questions in lab activities will be shared after the final lab session of the week has concluded (Thursday afternoon)