Two variables, one story
Hypothesis 2 asks whether, among students with jobs, more hours of work goes with less sleep. That is a question about the relationship between two numerical variables, so Amira uses the tools from Two-Variable Data Analysis and Validity: a scatter plot, the correlation coefficient, a least-squares line and residuals. She also builds a contingency table relating two categorical variables (job: yes or no; meets the guideline: yes or no), which gives a second view of Hypothesis 1.
Match the tool to the variable types:
- two numerical variables: scatter plot, r, r², regression line, residual plot;
- one categorical and one numerical: side-by-side box plots, group summaries (last lesson);
- two categorical variables: contingency table, conditional percentages, side-by-side or segmented bar graph.
The data for Hypothesis 2
The 22 students with jobs give these pairs (x = hours of paid work per week, y = school-night sleep in hours). From the example data set:
(6, 8.75), (9, 8.0), (14, 7.25), (16, 7.5), (18, 7.75), (5, 8.75), (15, 7.75), (6, 7.5), (20, 6.25), (12, 8.0), (8, 7.25), (12, 7.5), (8, 8.0), (25, 6.25), (10, 7.0), (22, 7.5), (15, 7.0), (24, 7.25), (10, 6.75), (4, 8.0), (12, 7.0), (20, 6.5)
The sums are: n = 22, Σx = 291, Σy = 163.5, Σxy = 2107.25, Σx² = 4665, Σy² = 1224.875.
Reading the residual plot
A good linear model leaves residuals that look like random scatter around 0. Watch for:
- a curve (the relationship is not linear);
- a fan (spread grows with x, so predictions are less reliable for large x);
- one large residual or a point far to the side (an outlier or influential point that may change the line).
Amira's residual plot shows none of these, so the linear model is appropriate. She also notes that predictions should stay within 4 to 25 hours of work; predicting the sleep of someone who works 40 hours a week would be extrapolation.