Menu
Sign up Sign in

AI HL · 13.4

Hypothesis Testing

13.4.17

Testing for correlation

13.4.17

Testing for correlation

Target: I can write H0: ρ = 0 and the alternative H1 for a test for correlation, defining ρ in context. (+4 more)

By the end of this section

Key points

The hypotheses

  • ρ (rho) is the correlation coefficient of the whole population. r is the correlation coefficient of your sample. The test uses r to judge ρ.
  • H0: ρ = 0 every time. It says there is no linear correlation in the population.
  • H1: ρ ≠ 0 for 'any correlation' (two-tailed). H1: ρ > 0 for 'positive correlation' or 'more … goes with more …'. H1: ρ < 0 for 'negative correlation'.
  • Define ρ in words, for example: ρ is the population correlation coefficient between depth and water temperature.

Running the test

  • The p-value depends on r, on the number of pairs n and on the alternative you choose. The calculator gives r and p together.
  • If p is less than the significance level, reject H0. Otherwise do not reject H0.
  • The conclusion goes in context: 'sufficient evidence of negative correlation between …' or 'insufficient evidence of correlation between …'.
  • A sample r that points away from H1 gives a large p-value. For H1: ρ < 0 and a positive r, p is above 0.5.

The assumption

  • The p-value is only valid if both variables are normally distributed. State this when the question asks for an assumption.
  • A scatter diagram that looks like an elliptical cloud supports the assumption. A strongly skewed variable puts it in doubt.
  • Not rejecting H0 does not prove that there is no correlation. It says that the sample gave no sufficient evidence.

On the calculator

Linear regression t test

  • Enter the x values in one list and the y values in another.
  • Choose the linear regression t test. Set the alternative to match H1: ρ < 0, ρ ≠ 0 or ρ > 0.
  • Read r and the p-value from the results.

Screenshot and video to come

The correlation coefficient r

  • Use the same two lists with the linear regression results to read r.
  • r is between −1 and 1. Its sign gives the direction of the trend.

Screenshot and video to come

Worked examples

Problems like the ones in class. Pick one, try it, then open the working.
Negative correlation

A student measures the temperature of a lake at seven depths. Depth (m): 1, 3, 5, 8, 12, 15, 20; Temperature (°C): 19.3, 17.8, 20.1, 19.3, 17.7, 15.4, 13.9. Test, at the 5% significance level, whether there is negative correlation between depth and water temperature. State the assumption you make.

Working
  1. Hypotheses

    H0: ρ = 0, H1: ρ < 0

    ρ is the population correlation coefficient between depth and water temperature. Negative correlation gives a lower-tail alternative.

  2. The test

    From the calculator: linear regression t test with H1: ρ < 0: r = −0.861, p = 0.00636

    Enter the two lists, choose the linear regression t test and set the alternative to ρ < 0.

  3. Compare

    0.00636 < 0.05

    The p-value is below the significance level.

  4. Conclusion

    Reject H0. There is sufficient evidence at the 5% level of negative correlation between depth and temperature.

    State it in the words of the question.

  5. Assumption

    Depth and temperature are both normally distributed.

    The p-value is only valid if both variables are normal.

Video walkthrough coming
Positive correlation, finding r

A gardener grows nine identical plants under different amounts of light. Light (hours per day): 6, 8, 9, 10, 12, 13, 14, 16, 18; Growth (cm): 7.6, 9.0, 11.0, 11.1, 12.1, 14.2, 16.4, 17.7, 17.2. Find r, then test at the 1% significance level whether more light is linked to more growth.

Working
  1. Hypotheses

    H0: ρ = 0, H1: ρ > 0

    ρ is the population correlation coefficient between hours of light and growth. More light, more growth: positive.

  2. The test

    From the calculator: linear regression t test with H1: ρ > 0: r = 0.968, p = 0.00000906

    The calculator gives r and p together.

  3. Compare

    0.00000906 < 0.01

    The p-value is below 1%.

  4. Conclusion

    Reject H0. There is sufficient evidence at the 1% level of positive correlation between hours of light and growth.

    Positive, as the question asked.

Video walkthrough coming
Any correlation, not significant

A food writer records the price and her rating of the lunch at eight cafés. Price (€): 6.5, 7.0, 8.5, 9.0, 10.5, 12.0, 13.5, 15.0; Rating (out of 10): 5.9, 6.6, 9.0, 8.0, 5.8, 8.0, 7.7, 8.9. Test, at the 5% significance level, whether there is any correlation between price and rating.

Working
  1. Hypotheses

    H0: ρ = 0, H1: ρ ≠ 0

    "Any correlation" means either direction: two-tailed.

  2. The test

    From the calculator: linear regression t test with H1: ρ ≠ 0: r = 0.500, p = 0.207

    Choose the alternative ρ ≠ 0.

  3. Compare

    0.207 > 0.05

    The p-value is above the significance level.

  4. Conclusion

    Do not reject H0. There is insufficient evidence at the 5% level of correlation between the price and the rating.

    Say 'insufficient evidence', not 'there is no correlation'.

Video walkthrough coming
The sample points the other way

A teacher believes that the more time students spend on their phones, the lower their test mark. She records both for nine students. Phone use (hours per day): 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 6.0; Test mark (%): 67, 38, 63, 58, 67, 62, 71, 61, 59. Test her belief at the 5% significance level.

Working
  1. Hypotheses

    H0: ρ = 0, H1: ρ < 0

    ρ is the population correlation coefficient between phone use and test mark. Her belief is negative correlation.

  2. The test

    From the calculator: linear regression t test with H1: ρ < 0: r = 0.217, p = 0.713

    The sample r is positive, so the data point away from H1 and the p-value is large.

  3. Compare

    0.713 > 0.05

    The p-value is far above 5%.

  4. Conclusion

    Do not reject H0. There is no evidence at the 5% level of negative correlation between phone use and test mark.

    The data do not support her belief at all.

Video walkthrough coming