38 Correlation

So far, you have learnt about the research process, including analysing data using confidence intervals and hypothesis tests. In the last chapter, you were introduced to plots for displaying the relationship between two quantitative variables. In this chapter, you will learn to:

  • produce correlation coefficients for exploring the relationship between two quantitative variables.
  • produce and interpret \(R^2\).
  • conduct hypothesis tests for correlation coefficients.

38.1 Introduction: red deer

So far, RQs about single variables and RQs for comparing two groups have been studied. Comparing the mean value of a quantitative variable in two groups was studied in Sects. 28 and 35. Comparing the odds of an outcome of interest in two groups was studied in Sects. 29 and 36. In this chapter (and the next), the relationship between two quantitative variables is studied when that relationship is approximately linear.

Consider the age and the weight of the molars of \(n = 78\) male red-deer (Holgate 1965), as seen in Sect. 17 (and the data in that section). The data comprises two quantitative variables, and the scatter plot is repeated in Fig. 38.1.

Molar weight verses age for the red deer data

FIGURE 38.1: Molar weight verses age for the red deer data

A linear relationship seems evident. That is, knowing the age of the deer seems to provide some information about the weight of the molars. Indeed, in Sect. 17.4.1, the correlation coefficient was found to be \(r = -0.584\)

However, as we have seen, only one of the many possible sample of deer have been studied, so potentially that relationship may not actually be present in the population. That is, perhaps the population correlation coefficient \(\rho\) is actually 0, and the sample correlation coefficient is non-zero simply due to sampling variation.

38.2 Statistical hypotheses and the hypothesistest

As usual, questions can be asked about the relationship between the variables in the population, as measured by the unknown population correlation coefficient:

In the population, is there a relationship between the value of \(y\) and the value of \(x\)?

In the context of the red-deer data, the RQ is:

In male red deer, is there a relationship between molar weight and age?

More specifically, we could ask a one-tailed research question:

In male red deer, does molar weight decrease as age increases?

This is a one-tailed RQ, about the population parameter \(\rho\). Clearly, the sample correlation coefficient \(r\) for the red-deer data is not zero, and the RQ is effectively asking if sampling variation is the reason for this. The null hypotheses is:

  • \(H_0\): \(\rho = 0\).

The parameter is \(\rho\), the population correlation coefficient. This hypothesis is the 'no relationship' position, which proposes that the population correlation coefficient is zero, and the sample correlation coefficient is not zero due to sampling variation. The alternative hypothesis is:

  • \(H_1\): \(\rho < 0\) (one-tailed test, based on the RQ).

As usual, initially assume that \(\rho = 0\) (from \(H_0\)), then describe what values of \(r\) could be expected, under that assumption, across all possible samples (sampling variation). Then the observed value of \(r\) is compared to the expected values to determine if the value of \(r\) supports or contradicts the assumption.

For a correlation coefficient, the sampling distribution of \(r\) does not have a normal distribution14, and the software output does not even provide a standard error, so we will not discuss CIs for the correlation coefficient.

The output (Fig. 38.2) contains the relevant \(P\)-value. The two-tailed \(P\)-value for the test is less than \(0.001\), so the one-tailed \(P\) value will be less than \(0.001/2 = 0.0005\). Very strong evidence exists to support \(H_1\) (that the correlation in the population is less than zero). We write:

The sample presents very strong evidence (one-tailed \(P < 0.0005\)) that the molar weight decreases as the age of the male red deer increases (\(r = -0.584\); \(n = 78\)) in the population.

Notice the three features of writing conclusions again: An answer to the RQ; evidence to support the conclusion ('one-tailed \(P < 0.0005\)'; here no test statistic is given in the output); and some sample summary information ('\(r = -0.584\); \(n = 78\)').

jamovi output for the red-deer data

FIGURE 38.2: jamovi output for the red-deer data

The evidence suggests that the correlation coefficient is not zero (in the population). However, a non-zero correlation doesn't necessarily mean a strong correlation exists. The correlation may be weak in the population (as estimated by the value of \(r\)), but evidence exists that the correlation is not zero in the population.

That is, the test is about statistical significance, not practical importance.

38.3 Statistical validity conditions

As usual, these results hold under certain conditions. The conditions for which the test is statistically valid are:

  1. The relationship is approximately linear.
  2. The variation in the response variable is approximately constant for all values of the explanatory variable.
  3. The sample size is at least \(25\).

The sample size of \(25\) is a rough figure; some books give other values.

Example 38.1 (Statistical validity) For the red-deer data, the scatterplot (Fig. 17.2) shows that the relationship is approximately linear, so using a correlation coefficient is appropriate. For the hypothesis test, the variation in molar weights doesn't seem to be obviously getting larger or smaller for older deer, and the sample size is also greater than \(25\). The test in Sect. 38.2 is statistically valid.

38.4 Example: removal efficiency

In wastewater treatment facilities, air from biofiltration is passed through a membrane and dissolved in water, and is transformed into harmless byproducts. The removal efficiency \(y\) (in %) may depend on the inlet temperature (in \(^\circ\)C; \(x\)). A RQ is

In treating biofiltation wastewater, is the removal efficiency associated with the inlet temperature?

The population parameter is \(\rho\), the correlation between the removal efficiency and inlet temperature. A scatterplot of \(n = 32\) samples (Fig. 38.3, left panel) suggests an approximately linear relationship (Chitwood and Devinny 2001; Devore and Berk 2007).

The output (Fig. 38.3, right panel) shows that the sample correlation coefficient is \(r = 0.891\), and so \(R^2 = (0.891)^2 = 79.4\)%. This means that about \(79.4\)% of the variation in removal efficiency can be explained by knowing the inlet temperature.

The relationship between removal efficiency and inlet temperatureThe relationship between removal efficiency and inlet temperatureThe relationship between removal efficiency and inlet temperature

FIGURE 38.3: The relationship between removal efficiency and inlet temperature

To test if a relationship exists in the population, write:
\[ \text{$H_0$: } \rho = 0;\quad\text{and}\quad \text{$H_1$: } \rho \ne 0. \] The alternative hypothesis is two-tailed (as implied by the RQ). The software output (Fig. 38.3, right panel) shows that \(P < 0.001\). We conclude:

The sample presents very strong evidence (two-tailed \(P < 0.001\)) that removal efficiency depends on the inlet temperature (\(r = 0.891\); \(n = 32\)) in the population.

The relationship is approximately linear, there is no obvious non-constant variance, and the sample size is larger than \(25\), so the hypothesis test results is statistically valid.

38.5 Chapter summary

In this chapter, correlation was used to describe the strength and direction of linear relationships between two quantitative variables.

Correlation coefficients (denoted \(r\) in the sample; \(\rho\) in the population) are always between \(-1\) and \(+1\). Positive values denote positive relationships between the two variables: as one values gets larger, the other tends to get larger too. Negative values denote negative relationships between the two variables: as one values gets larger, the other tends to get smaller. Values close to \(-1\) or \(+1\) are very strong relationships; values near zero shows very little linear relationship between the variables. Hypothesis tests for \(r\) can be conducted using software.

Sometimes, \(R^2\) is used to describe the relationship: it indicates what percentage of the variation in the response variable can be explained by knowing the value of the explanatory variables.

The following short video may help explain some of these concepts:

38.6 Quick review questions

A study of Chinese paediatric patients (Wong et al. 2018) studied the relationship between the \(6\)-minute walk distance (\(6\)MWD) and maximum oxygen uptake (VO\(2\)max) for \(n = 29\) patients. The correlation coefficient is reported as \(r = 0.457\), and the corresponding \(P\)-value as \(P = 0.013\).

  1. What is the \(x\)-variable?
  2. True or false: Since the \(P\)-value is small, the correlation is quite strong.
  3. How is the relationship best described?
  4. What is the value of \(R^2\) (to one decimal place, expressed as a percentage)?
  5. For statistical validity, what do we need to assume to be true?
  6. True or false? Since \(P\) is small, the relationship must be very strong.

38.7 Exercises

Answers to odd-numbered exercises are available in App. E.

Exercise 38.1 NEED NEW EXERCISE. About drawing or estimating linear relationships from scatterplot?

Exercise 38.2 [Dataset: Lime] Consider the scatterplot in Fig. 17.10, for the foliage biomass of lime trees.

  1. Describe the relationship.
  2. Would a correlation coefficient be appropriate? Explain.

Exercise 38.3 A study of \(n = 30\) paramedicine students examined the relationship between the amount of stress experienced while performing drug-dose calculations (measured using the State–Trait Anxiety Inventory (STAI)), and length of work experience (LeBlanc et al. 2005).

  1. Write the hypotheses for testing for a relationship between the STAI score and the length of work experience.
  2. The article gives the correlation coefficient as \(r = 0.346\) and \(P = 0.18\). What do you conclude?
  3. What must be assumed for the test to be statistically valid?

Exercise 38.4 [Dataset: Dogs] A study of Phu Quoc Ridgeback dogs (Canis familiaris) recorded many measurements of the dogs, including body length and body height (Quan, Tran, and Chung 2017). The scatterplot for the relationship is shown in Fig. 38.4 (left panel), and the jamovi output in Fig. 38.4 (right panel). In this example, it does not matter which variable is used as \(x\) or \(y\).

  1. Describe the relationship.
  2. Taller dogs might be expected to be longer. To test this, write the hypotheses.
  3. Perform the test, using the output. Write a conclusion.
  4. Is the test statistically valid?
Phu Quoc ridgeback dogs: Left: a scatterplot of the body height vs body length. Right: jamovi outputPhu Quoc ridgeback dogs: Left: a scatterplot of the body height vs body length. Right: jamovi outputPhu Quoc ridgeback dogs: Left: a scatterplot of the body height vs body length. Right: jamovi output

FIGURE 38.4: Phu Quoc ridgeback dogs: Left: a scatterplot of the body height vs body length. Right: jamovi output

Exercise 38.5 [Dataset: SDrink] A study examined the time taken to deliver soft drinks to vending machines (Montgomery and Peck 1992) using a sample of size \(n = 25\) (Fig. 38.5, left panel). To perform a test of the correlation coefficient, are the statistical validity conditions met?

The time taken to deliver soft drinks to vending machines

FIGURE 38.5: The time taken to deliver soft drinks to vending machines

Exercise 38.6 [Dataset: Bitumen] A study of hot mix asphalt (Panda, Das, and Sahoo 2018) created \(n = 42\) samples of asphalt and measured the volume of air voids and the bitumen content by weight (Fig. 38.5, right panel).

  1. Using the plot, estimate the value of \(r\).
  2. The value of \(R^2\) is \(99.29\)%. What is the value of \(r\)? (Hint: Be careful!)
  3. Would you expect the \(P\)-value testing \(H_0\): \(\rho=0\) to be small or large? Explain.
  4. Would the test be statistically valid?

Exercise 38.7 [Dataset: Punting] A study (Myers (1990), p. 75) of American footballers measured the right-leg strengths \(x\) of 13 players (using a weight lifting test), and the distance \(y\) they punted a football with their right leg (Fig. 38.6, left panel). Use the jamovi output (Fig. 38.6, left panel) to answer these questions.

  1. Compute the value of \(R^2\), and explain what this means.
  2. Perform a hypothesis test to determine if a positive correlation exists between punting distance and right-leg strength.
Punting distance and right leg strength

FIGURE 38.6: Punting distance and right leg strength

jamovi output for the punting data

FIGURE 38.7: jamovi output for the punting data

Exercise 38.8 [Dataset: Gorillas] (These data were also seen in Exercise 17.8.) A study (Wright et al. 2021) examined \(25\) gorillas and recorded information about their chest beating and their size (measured by the breadth of the gorillas' backs). The relationship is shown in a scatterplot in Fig. 17.12 (left panel). Using the output (Fig. 38.8), determine the value of \(r\) and \(R^2\). Perform a hypothesis tests, and make a conclusion about the relationship between the chest beating and size of gorillas.

Output for the gorilla data

FIGURE 38.8: Output for the gorilla data

Exercise 38.9 [Dataset: Possums] A study of Leadbeater's possums in the Victorian Central Highlands (J. L. Williams et al. 2022) recorded, among other information, the body weight of the possums and their location, including the elevation of the location. A scatterplot of the data and the jamovi output are shown in Fig. 38.9. Using the output (Fig. 38.9), determine the value of \(r\) and \(R^2\). Perform a hypothesis tests, and make a conclusion about the relationship between the chest beating and size of gorillas.

The relationship between weight of possums and the elevation of their location. Left: scatterplot. Right: jamovi outputThe relationship between weight of possums and the elevation of their location. Left: scatterplot. Right: jamovi output

FIGURE 38.9: The relationship between weight of possums and the elevation of their location. Left: scatterplot. Right: jamovi output

Exercise 38.10 [Dataset: Soils] The California Bearing Ratio (CBR) value is used to describe soil-sub grade for flexible pavements (such as in the design of air field runways). One study (Talukdar 2014) examined the relationship between CBR and other properties of soil, including the plasticity index (PI, a measure of the plasticity of the soil). The scatterplot from 16 different soil samples from Assam, India, is shown in Fig. 38.10.

  1. Using the plot, take a guess at the value of \(r\).
  2. The value of \(R^2\) is \(67.07\)%. What is the value of \(r\)? (Hint: Be careful!)
  3. Would you expect the \(P\)-value testing \(H_0\): \(\rho = 0\) to be small or large? Explain.
  4. Would the test be statistically valid?
The relationship between CBR and PI in sixteen soil samples

FIGURE 38.10: The relationship between CBR and PI in sixteen soil samples

Exercise 38.11 [Dataset: Typing] The Typing dataset contains four variables: typing speed (mTS), typing accuracy (mAcc), age (Age). and sex (Sex) for \(1301\) students (Pinet et al. 2022). Is there evidence of a relationship between the mean typing speed and mean accuracy? Explain.