Correlation Tests0%

Statistics · Topic 10 of 13

Correlation Tests

Video coming soon3 worked examples

Theory

A correlation test is used to explore whether a statistically significant linear relationship exists between two numerical variables. Remember, even if a strong relationship is found, no variables are being directly manipulated, so we cannot establish cause and effect (correlation does not imply causation).

1. Formulating Hypotheses for Correlation

For a correlation test, the hypotheses are always written in terms of a linear relationship. Pearson's coefficient only measures how close the points lie to a straight line, so the word "linear" matters:

  • Null Hypothesis (H0): There is no linear relationship between [Variable 1] and [Variable 2].
  • Alternative Hypothesis (H1): There is a linear relationship between [Variable 1] and [Variable 2].

2. Performing the Test in R Studio

  • The code used to run this test is cor.test(X, Y).
  • This command outputs three vital pieces of information that you must be able to extract and interpret: the p-value, the correlation coefficient (cor), and the 95 percent confidence interval.

3. Interpreting the Output (The Exam Rules)

  • The p-value: Look at the p-value. If p < 0.05, you reject the null hypothesis and conclude there is evidence of a linear relationship. If p ≥ 0.05, you fail to reject the null hypothesis.
  • The Correlation Coefficient (cor): This is found at the very bottom of the R Studio output under sample estimates: cor. You must use this number to comment on the strength (weak, moderate, strong) and direction (positive, negative) of the linear relationship.
  • The Confidence Interval: We can be 95% confident that the true population correlation lies between the two numbers given in the interval.
    • If the interval contains zero (i.e., it goes from a negative number to a positive number), zero is a plausible value for the true correlation, so there is not enough evidence of a linear relationship. This is consistent with a decision to fail to reject the null hypothesis.
    • If the interval does not contain zero, it provides further statistical evidence that a relationship truly exists.

Worked examples

Example 1

Example 1: Significant Relationship & Output Interpretation

A researcher is investigating whether there is a relationship between the number of hours athletes spend practising a specific drill per week and their success rate (%) in matches. They run a correlation test in R Studio and get the following output:

Pearson's product-moment correlation

data: Practice.Hours and Success.Rate

t = 5.342, df = 45, p-value = 0.00000281

alternative hypothesis: true correlation is not equal to 0

95 percent confidence interval:

0.485122 0.812344

sample estimates:

cor

0.684511

  • (a) State the appropriate null and alternative hypotheses for this test.
  • (b) Interpret the p-value and the result of the hypothesis test in context.
  • (c) Make a comment about the correlation coefficient.
  • (d) Interpret the confidence interval and explain how it supports your conclusion.

(a)

H0: There is no relationship between practice hours and success rate.

H1: There is a relationship between practice hours and success rate.

(b) Since the p-value (0.00000281) is less than 0.05, we reject the null hypothesis. There is evidence to suggest a statistically significant relationship between practice hours and success rate.

(c) The correlation coefficient is 0.6845, which indicates a moderate positive correlation between practice hours and success rate.

(d) We can be 95% confident that the true population correlation lies between 0.4851 and 0.8123. Because this interval does not contain zero, it provides further evidence that a true positive correlation exists.

Example 2

Example 2: Failing to Reject the Null Hypothesis

A student tests whether there is a relationship between a person's shoe size and their typing speed in words per minute (WPM). The R Studio output generates a p-value of 0.415 and a 95% confidence interval of [-0.215, 0.455]. The sample correlation estimate (cor) is 0.112.

  • (a) State whether the student should reject or fail to reject the null hypothesis, and state their conclusion in context.
  • (b) Use the correlation coefficient and the confidence interval to justify why this was the correct decision.

(a) Since the p-value (0.415) is greater than 0.05, the student must fail to reject the null hypothesis. There is no evidence to suggest a linear relationship between shoe size and typing speed.

(b) The correlation coefficient of 0.112 is very close to zero, indicating almost no linear relationship. Furthermore, the 95% confidence interval [-0.215, 0.455] contains zero, meaning it is entirely possible that the true population correlation is exactly 0.

Example 3

Example 3: Predictions and Extrapolation

Following on from the practice hours and success rate study in Example 1, the researcher notes that the practice hours recorded in their sample ranged from 2 hours to 10 hours. They use software to predict the success rate of an athlete who practises for 25 hours a week. Comment on the likely accuracy of this prediction.

This prediction is unlikely to be accurate. Although there is a positive correlation, 25 hours is far above the maximum value of 10 hours observed in the sample data. Predicting outside the range of the data is called extrapolation and is generally unreliable.