33 Correlation and regression: CIs and tests

So far, you have learnt about the research process, including analysing data using confidence intervals and conducting hypothesis tests. In this chapter, you will learn to:

  • produce confidence intervals for correlation coefficients.
  • conduct hypothesis tests for correlation coefficients.
  • produce and interpret linear regression equations.
  • conduct hypothesis tests for the slope of a regression line.
  • produce confidence intervals for the slope of a regression line.
  • determine whether the conditions for using these methods apply in a given situation.

33.1 Introduction: sorghum yield and borers

So far, RQs about single variables (descriptive RQs) and RQs for comparisons (relational and repeated-measures RQs) have been studied. In this chapter, the relationship between two quantitative variables is studied (correlational RQs) when that relationship is approximately linear. The strength of the relationship (correlation) and the nature of that relationship (regression) are discussed.

For this chapter, consider this (one-tailed) RQ:

In sorghum crops (AG1090 hybrid) in Brazil, is a larger sugarcane borer infestation associated with smaller yields?

C. da S. F. Souza et al. (2024) recorded the borer infestation in sorghum crops, for n=24n=24 crops over three years (C. Souza et al. 2024), shown in Fig. 33.1. The data comprises two quantitative variables (Fig. 33.2, left panel).

FIGURE 33.1: The sorghum-yield data.

Knowing the amount of infestation provides some information about the yield: a moderate relationship between the variables seems evident. The relationship also seems somewhat linear. The Pearson correlation coefficient (Fig. 33.2, right panel) is r=0.934r=0.934, so R2=(0.934)2=87.2R2=(0.934)2=87.2%. This means that the unexplained variation in yield reduces by 78.878.8% by knowing the amount of infestation.

Recall that the sample correlation coefficient is denoted by rr, and the population correlation coefficient is denoted by ρρ.

Sorghum yield against borer infestation. Left: scatterplot. Right: correlation output.Sorghum yield against borer infestation. Left: scatterplot. Right: correlation output.

FIGURE 33.2: Sorghum yield against borer infestation. Left: scatterplot. Right: correlation output.

33.2 Correlation: CIs and tests for ρρ

33.2.1 Correlation: CIs for ρρ

The sorghum data in Fig. 33.1 is only one of the countless possible samples of sorghum crops that could have been studied. The value of rr (an estimate of ρρ, the parameter) will vary from sample to sample; that is, the value of rr has a sampling distribution, and sampling variation exists. The sampling distribution of rr, however, does not have a normal distribution, so CIs for ρρ will be taken directly from software output (Fig. 33.2, right panel). For the sorghum data, the 9595% CI for ρρ is from 0.9710.971 to 0.8510.851. This CI is not symmetrical: the value of rr is not halfway between these limits. We write:

For soghum crops, the correlation coefficient between yield and infestation percentage is 0.9340.934, with a 9595% CI from 0.9710.971 to 0.8510.851 (n=24n=24).

In other words, a population with a correlation coefficient ρρ between 0.9710.971 and 0.851 could reasonably have produced a sample correlation coefficient of r=0.934 from a sample of size n=24.

Example 33.1 (Correlation) The relationship between the number of cyclones y in the Australian region each year from 1969 to 2005, and a unitless climatological index called the Ocean Niño Index (ONI, x), averaged over October, November and December, is shown in Fig. 33.3 (left panel) (P. K. Dunn and Smyth 2018).

The relationship has a negative direction, so the value of r is negative. From the software output, r=0.683 with a 95% CI from 0.824 to 0.460.

The number of cyclones in the Australian region each year from 1969 to 2005, and the ONI averaged over October, November, December. Left: scatterplot. Right: software output.The number of cyclones in the Australian region each year from 1969 to 2005, and the ONI averaged over October, November, December. Left: scatterplot. Right: software output.

FIGURE 33.3: The number of cyclones in the Australian region each year from 1969 to 2005, and the ONI averaged over October, November, December. Left: scatterplot. Right: software output.

33.2.2 Correlation: hypothesis test for ρ

A hypothesis test can also be conducted regarding ρ, the Pearson correlation coefficient in the population. The null hypothesis is, as always, the 'no difference, no change, no relationship' position which is, in this context:

  • H0: ρ=0.

Clearly, the sample correlation coefficient r for the data is not zero, and the RQ is effectively asking if sampling variation is the reason for this discrepancy between r and the parameter ρ.

Since the RQ (in Sect. 33.1) is one-tailed (negative direction), the alternative hypothesis is:

  • H1: ρ<0 (one-tailed test, based on the RQ).

As usual, initially assume that ρ=0 (from H0), then describe what values of r could be expected using the sampling distribution, under that assumption, across all possible samples. Then the observed value of r is compared to the values expected through sampling variation 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 distribution.8 However, the output (Fig. 33.2, right panel) contains the relevant two-tailed P-value for the test: less than 0.001. Hence, the one-tailed P-value for the test is less than 0.0005. Very strong evidence exists to support H1 (that the correlation in the population is negative).

We write:

The sample presents very strong evidence (one-tailed P<0.0005) that the sorghum yield has a negative association with borer infestation percentage (r=0.934 with 95% CI from 0.971 to 0.851; n=24) in the population.

Notice the three features of writing conclusions again: an answer to the RQ, evidence to support the conclusion, and some sample summary information.

If the evidence suggests that the correlation coefficient is not zero (in the population), this does not 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.

Example 33.2 (Correlation) The relationship between the number of cyclones y in the Australian region each year from 1969 to 2005, and the ONI x is shown in Fig. 33.3 (left panel). To test for a relationship, use H0ρ=0 againstH0ρ0; software reports that P<0.0001 (Fig. 33.3, right panel). There is very strong evidence of a relationship between the number of cyclones in the Australian region and the ONI (averaged over October, November and December).

33.3 Regression

33.3.1 Introducting regression

Correlation measures the strength and direction of the linear relationship between two quantitative variables x (an explanatory variable) and y (a response variable). Sometimes, however, describing the nature of the relationship is useful. This is called regression.

The regression relationship is described mathematically using an equation, and allows us to:

  1. Predict the mean value of y from a given value of x (Sect. 33.3.4).
  2. Understand the relationship between x and y (Sect. 33.3.5).

An example of a linear regression equation, describing the linear relationship between the observed values of an explanatory variable x and the observed values of a response variable y, is ˆy=4+(2×x),usually writtenˆy=4+2x. The notation ˆy refers to the mean of all the y-values that could be observed for some given value of x. That is, for some value of x, many different values of y could be observed, and ˆy is the value that regression equation predicts as the mean of all those possible values. This equation describes the connection between the values of x and the corresponding average values of y.

y refers to the values of the response variable observed from individuals. ˆy refers to predicted mean value of y for given values of x.

ˆy is pronounced as 'why-hat'; the 'caret' above the y is called a 'hat'.

More generally, the equation of a straight line is ˆy=b0+(b1×x),usually writtenˆy=b0+b1x, where the values of b0 and b1 are unknown, and estimated from sample data. Notice that b1 is the number multiplied by x. In Equation (33.1), b0=4 and b1=2.

Example 33.3 (Regression equations) A report on the growth of Australian children (Pfizer Australia 2008) found an approximate linear relationship between the age (in years) x and height (in cm) y of girls aged between four and seven. The regression equation was approximately ˆy=73+7x. The regression equation is the same if written as ˆy=7x+73. In both cases, b0=73 and b1=7. This regression equation describes the connection between ages x and heights y for girls aged between four and seven.

33.3.2 Reviewing linear equations

To introduce, or revise, the idea of a linear equation, consider the (artificial) data in Fig. 33.4, with an explanatory variable x and a response variable y. In the graph, a sensible line is drawn on the graph that seems to capture the relationship between x and y. (You may have drawn a slightly different, but similar, line.) The line describes the predicted mean values of y (i.e., values of ˆy) for various values of x. The relationship is positive and linear.

A regression equation specifies the line. In the regression equation ˆy=b0+b1x, the numbers b0 and b1 are called regression coefficients, where

  • b0 is the intercept (or the y-intercept), whose value corresponds to the predicted mean value of y when x=0.
  • b1 is the slope, whose value measures how much the value of ˆy changes, on average, when the value of x increases by 1.

We will use software to find the values of b0 and b1 (as the formulas are tedious to use). However, a rough approximation of the values of b0 and b1 can be obtained using the rough straight line drawn on the scatterplot (Fig. 33.4).

A rough approximation of the value of the intercept b0 is the value of ˆy when x=0, from the drawn line. When x=0, the regression line suggests the value of ˆy is about 2 ; that is, the value of b0 is approximately 2.

A rough approximation of the slope b1 is found using

Change in yCorresponding INCREASE in x=riserun

from the drawn line. This approximation of the slope is the change in the value of ˆy (the 'rise') divided by the corresponding increase in the value of x (the 'run').

An example scatterplot.

FIGURE 33.4: An example scatterplot.

Consider what happens in the animation below when the value of x increases from 1 to 5 (a run of 51=4). The corresponding value of y changes from about 5 to about 17, a rise of 175=12. So, using Equation (33.2), riserun=17551=124=3. The value of b1 is about 3. When using rise-over-run, better guesses for b1 are found when using one value of x near the left-side of the scatterplot, and another value of x near the right-side of the scatterplot, but any two values can be used (try using x=0 and x=3).

Combing the rough guesses for b0 and b1, the regression line is approximately ˆy=2+(3×x), usually written ˆy=2+3x.

The regression equation has ˆy (not y) on the left-hand side. That is, the equation predicts the mean values of y, which may not be equal to any of the observed values (which are denoted by y).

A 'good' regression equation would produce predicted values ˆy close to the observed values y; that is, the line passes close to each point on the scatterplot.

The intercept b0 has the same measurement units as the response variable. The measurement units for the slope b1 is the 'measurement units of the response variable', per 'measurement units of the explanatory variable'.

Example 33.4 (Measurement units of regression parameters) In Example 33.3, the regression line for the relationship between the age of Australian girls x (in years) and their height (in cm) y was ˆy=73+7x (for girls aged between four and seven years).

In the equation, the intercept is b0=73cm and the slope is b1=73cm/y (the growth rate).

Example 33.5 (A rough approximation of the regression equation) For the sorghum data, a rough estimate of the regression line can be drawn on a scatterplot to estimate b0 and b1 (Fig. 33.5). The estimate of b0 (the value of ˆy when x=0) is roughly 4800kg.ha1.

The estimate of b1 can be found using the rise-over-run idea. When x=0, the value of ˆy (according to the drawn line) is about 4800. At the other extreme of the plot, where x=40, the value of ˆy is about 1000. (Any two points on the line can be used, but using two points at each end gives better guesses of the slope.) So, as x increases from 0 to about 40, the value of ˆy reduces from about 4800 to about 1000, a change of about 3800. That is, for a 'run' of 400=40, the 'rise' is 48001000=3800 (i.e., a drop of 3800), and so a rough estimate of the slope is 3800/40=95. (The relationship is negative, so the slope is negative.)

The rough guess of the regression line is therefore ˆy=480095x, where x is the infestation percentage, and y is yield (in kg.ha1). The rough guess of the intercept b0 is 4800kg.ha1, while the rough guess of the slope b1 is 95kg.ha1/%.

Obtaining rough guesses for the regression equation for the sorghum data. Left: approximating $b_0$. Right: approximating $b_1$ using rise-over-run. The plus signs on the right plot indicate the points used to estimate the slope.

FIGURE 33.5: Obtaining rough guesses for the regression equation for the sorghum data. Left: approximating b0. Right: approximating b1 using rise-over-run. The plus signs on the right plot indicate the points used to estimate the slope.

You may like the following interactive activity, which explores slopes and intercepts.

Example 33.6 (Estimating regression parameters) The relationship between the number of cyclones y in the Australian region each year from 1969 to 2005, and the ONI x is shown in Fig. 33.3 (left panel).

To make a guess of the regression coefficients, a sensible line can be drawn through the data (Fig. 33.6). When the value of x is zero, the predicted value of y is about 12, so b0 is about 12 cyclones. Recall: the intercept is the predicted value of y when x=0, which is not at the left of the graph in Fig. 33.6.

To approximate the value of b1, use the rise-over-run idea. When x=2, the predicted mean value of y is about 17; when x=2, the predicted mean value of y is about 8. The value of x increases by 2(2)=4, while the value of ˆy changes by 7.517=9.5 (a decrease of about 9.5). Hence, b1 is approximately 9.5/4=2.375 cyclones per unit change in ONI. (You may get a slightly different value from a slightly different line.)

The relationship has a negative direction, so the slope must be negative. The regression line is approximately ˆy=122.375x.

The number of cyclones in the Australian region each year from 1969 to 2005, and the ONI averaged over October, November, December. An estimate of the reggression line is shown. The plus sign ${}+{}$ is located on the line where $x = 0$. The crosses ${}\times{}$ are located to find rise-over-run.

FIGURE 33.6: The number of cyclones in the Australian region each year from 1969 to 2005, and the ONI averaged over October, November, December. An estimate of the reggression line is shown. The plus sign + is located on the line where x=0. The crosses × are located to find rise-over-run.

The above method gives a crude approximation to the values of the intercept b0 and the slope b1. In practice, many reasonable lines could be drawn through a scatterplot of data, each giving slightly different rough guesses for b0 and b1. However, one of those lines is the 'best' line in some sense,9 and is sometimes called the 'line of best fit'.

33.3.3 Regression: finding equations using software

Software is almost always used to find the estimates for the intercept b0 and slope b1, as the formulas are complicated and tedious to use. For the sorghum data (Fig. 33.2), the relevant software output is shown in Fig. 33.7.

In the output, the values of b0 and b1 are in the column labelled Estimate; the value of the sample y-intercept is b0=4814.1kg.ha1, and the value of the sample slope is b1=101.4kg.ha1/%. These are the values of the two regression coefficients. The regression equation is, after rounding: ˆy=4814.1+(101.4×x),usually written asˆy=4814.1101.4x. These are close to the values obtained using the rough method in Sect. 33.3.2 (which gave b0=4800 and b1=95 approximately).

The sign of the slope b1 and the sign of correlation coefficient r are always the same. For example, if the slope is negative, the correlation coefficient will be negative. However, the value of the slope cannot be deduced solely from the value of the correlation coefficient, nor can the value of the correlation coefficient be deduced solely from the value of the slope.

The regression output for the sorghum data.

FIGURE 33.7: The regression output for the sorghum data.

Example 33.7 (Regression coefficients) The regression equation for the cyclone data (Fig. 33.6) is found from the software output (Fig. 33.8) as ˆy=12.12.23x, where x is the ONI (averaged over October, November, December) and y is the number of cyclones; that is, b0=12.1 cyclones and b1=2.23 cyclones per unit change in ONI. These values are close to the approximations made in Example 33.6 (b0=12 and b1=2.375 respectively).

The software output for the cyclone data.

FIGURE 33.8: The software output for the cyclone data.

You may like the following interactive activity, which explores regression equations.

33.3.4 Regression: making predictions

Regression equations can be used to make predictions of the mean value of y for a given value of x. For example, the regression equation for the sorghum data in Equation (33.3) can be used to make predictions of the mean yield for a given infestation percentage. For example, the equation can be used to predict the average yield of crops with an infestation percentage of 30%. Since x represents the infestation percentage, use x=30 in the regression equation: ˆy=4814.1(101.4×30)=4814.13042=1772.1. Crops with an infestation percentage of 30% are predicted to have a mean yield of 1772.1kg.ha1 (though individual crops with an infestation percentage of 30% may have smaller or greater yields). The model predicts that the mean yield for crops with an infestation percentage of 30% will be about 1772.1kg.ha1.

The value of ˆy is computed using the estimates b0 and b1, which are computed from sample data. Hence, the value of ˆy also depends on which one of the countless possible samples is used. This means that ˆy also has a sampling distribution and a standard error.

Suppose we were interested in crops with an infestation percentage of 50%; the mean yield is ˆy=4814.1(101.4.39×50)=255.9, or about 256kg.ha1, which is clearly silly (negative yields are impossible). In the data, the heaviest infestation is about 40%, so no data exists beyond a 40% infestation percentage. As a result, the regression line does not even apply for infestations exceeding 40%. (This means that the relationship must be non-linear after 40%.)

Making predictions outside the range of the available data is called extrapolation, and extrapolation beyond the data may lead to nonsense predictions.

Definition 33.1 (Extrapolation) Extrapolation refers to making predictions outside the range of the available data. Extrapolation beyond the data may lead to nonsense.

Example 33.8 (Extrapolation) The regression equation (Example 33.3) used to predict the mean height of girls ˆy from their age x (for girls aged between four and seven) was given as ˆy=73+7x. For girls five years-of-age (i.e., x=5), the predicted mean height is ˆy=73+(7×5)=73+35=108. The heights of girls will vary around a mean height of 108cm; some individual girls aged five will be taller than 108cm, and some will be shorter than 108cm.

Using the equation to estimate the height of girls aged 21 would predict a mean height of 220cm. However, this is extrapolation and the prediction is nonsense. Young children grow at a fast rate, but growth rate slows as children age.

33.3.5 Regression: understanding relationships

The regression equation can be used to understand the relationship between the two variables. Consider again the sorghum regression equation: ˆy=4814.1101.4x. What does this equation reveal about the relationship between x and y?

b0 is the predicted value of ˆy when x=0 (Sect. 33.3.3). Using x=0 in Equation (33.4) predicts a mean yield of ˆy=4814.1(101.4×0)=4814.1 for crops with an infestation of zero; this is the value of b1. Sometimes, using x=0 is extrapolating, as no data exists near x=0, so sometimes this interpretation of b0 produces nonsense.

The value of the intercept b0 is sometimes (but not always) meaningless. The value of the slope b1 is usually of greater interest, as it explains the relationship between the two variables.

The slope b1 quantifies how the value of ˆy changes (on average) when the value of x increases by one (Sect. 33.3.3). For the sorghum data, b1 is the change in predicted mean yield for each percentage point10 increase in borer infestation.

Specifically, each extra percentage point of borer infestation is associated with a mean change in yield of 101.4kg.ha1 (from Equation (33.4)); that is, a decrease in yield by a mean of 101.4kg.ha1 for each extra percentage point of infestation.

To demonstrate, consider the case where x=10, when the regression equation predicts ˆy=3800.1kg.ha1. For infestations one percentage point greater than this (i.e., x=11), the value of the prediction ˆy will increase by an average of 101.4kg.ha1 (or, equivalently, decrease by an average of 101.4kg.ha1). That is, we would predict ˆy=3800.1101.4=3698.7kg.ha1. This is the same prediction made by using x=11 in Equation (33.4).

If the value of b1 is positive, then the predicted mean values of y increase as the values of x increase. If the value of b1 is negative, then the predicted mean values of y decrease as the values of x increase.

This interpretation of b1 explains the relationship: the predicted mean yield is, on average, about 101.4kg.ha1 less for each extra percentage point increase of infestation.

In general, we say that a change in the value of x is associated with a change in the value of ˆy. Unless the study is experimental (Sect. 4.4), we cannot say that the change in the value of x causes the change in the value of ˆy.

If the value of the slope is zero, there is no linear relationship between x and ˆy. A slope of zero means that a change in the value of x is associated with a change of zero in the value of ˆy. In this case, the correlation coefficient is also zero.

33.4 Regression: CIs and t-test for regression parameters

33.4.1 Introduction

A regression equation exists in the population that connects the values of x and ˆy. This regression line is estimated from one of the countless possible samples, and is an estimate of the regression line in the population.

In the population, the intercept is denoted by β0 and the slope by β1. The values of the parameters β0 and β1 are unknown, and are estimated by the statistics b0 and b1 respectively.

The symbol β is the Greek letter 'beta', pronounced 'beater' (as in 'egg beater'). So β0 is pronounced as 'beater-zero', and β1 as 'beater-one'.

Every sample is likely to produce slightly different values for both b0 and b1 (sampling variation), so both b0 and b1 have a sampling distribution and a standard error. The formulas for computing the values of b0 and b1 (and their standard errors) are intimidating, so we will use software to perform the calculations. The sampling distributions for b0 and b1 have approximate normal distributions under certain conditions (Sect. 33.5).

Usually the slope is of greater interest than the intercept, because the slope explains the relationship between the two variables (Sect. 33.3.5). For this reason, the sampling distribution for the slope only is given below, but the sampling distribution for the intercept is analogous.

Definition 33.2 (Sampling distribution of a sample slope) The sampling distribution of the sample regression slope is (when certain conditions are met; Sect. 33.5) described by

  • an approximate normal distribution,
  • with a mean of β1, and
  • a standard deviation, called the standard error of the slope and denoted s.e.(b1).

A formula exists for finding s.e.(b1), but is tedious to use, and we will not give it.

33.4.2 CIs for the regression parameters

The sampling distribution describes all possible values of the sample slope from all possible samples, through sampling variation. For the sorghum data then, the values of the sample slope across all possible samples is described (Fig. 33.9) as, using Def. 33.2:

  • an approximate normal distribution,
  • with a sampling mean whose value is β1, and
  • a standard deviation of s.e.(b1)=8.279 (from software; Fig. 33.7).
The distribution of sample slope for the sorghum data, around the population slope\ $\beta_1$.

FIGURE 33.9: The distribution of sample slope for the sorghum data, around the population slope β1.

Since the sampling distribution is an approximate normal distribution, CIs have the form statistic±(multiplier×standard error), where the multiplier is 2 for an approximate 95% CI (from the 68--95--99.7 rule). In this context, a CI for the slope is b1±(multiplier×s.e.(b1)). Thus, an approximate 95% CI for the slope is 101.4±(2×8.279)or101.4±16.558, which is from 118.0 to 84.8kg.ha1 (after rounding).

Software can be used to produce exact CIs too; the exact 95% CI is from 118.6 to 84.3kg.ha1 (Fig. 33.10). The approximate and exact 95% CIs are very similar. We write:

For each increase of one percentage point in borer infestation, the mean yield increases by 101.4kg.ha1 (95% CI: 118.6 to 84.3; n=24).

Alternatively (and equivalently, but easier to understand):

For each increase of one percentage point in borer infestation, the mean yield decreases by 101.4kg.ha1 (95% CI: 84.3 to 118.6; n=24).

Output for the sorghum data, including the CIs for the regression parameters.

FIGURE 33.10: Output for the sorghum data, including the CIs for the regression parameters.

Example 33.9 (Cyclones) Using the software output (Fig. 33.8) for the cyclone data, s.e.(b1)=0.404, so the approximate 95% CI for the regression slope β1 is 2.23±(2×0.404)\qquad {or}\qquad2.23±0.808. The interval from 3.04 to 1.42 is likely to straddle the population slope. This approximate CI is very similar to the exact CI shown in Fig. 33.8.

33.4.3 Regression: t-tests for regression parameters

Since the regression line describing the relationship between x and ˆy is computed from one of countless possible samples, any relationship observed in the sample may be due to sampling variation; possibly, no relationship actually exists in the population (i.e., β1=0). In other words, a hypothesis test can be conducted for the slope to determine if sampling variation can explain the discrepancy between β1 and b1. (Similar hypothesis tests can be conducted for testing if the intercept is zero, but are usually of less interest.)

The null hypothesis for tests about the slope is the usual 'no relationship' hypothesis. In this context, 'no relationship' means that the slope is zero (Sect. 33.3.5), so the null hypothesis (about the population) is H0: β1=0. A slope of β1=0 is equivalent to no relationship between the variables. (We would also find ρ=0.)

For the sorghum data, the RQ implies these hypotheses about the slope: H0β1=0andH1β1<0. The parameter is β1, the population slope for the regression equation predicting yield from infestation percentage. The alternative hypothesis is one-tailed, based on the RQ.

Assuming the null hypothesis is true (i.e., that β1=0), the possible values of the sample slope b1 can be described (Def. 33.2).

For the sorghum data, the variation in the sample slope across all possible samples when β1=0 is described (Fig. 33.11) using:

  • an approximate normal distribution,
  • with a sampling mean whose value is β1=0 (from H0), and
  • a standard deviation of s.e.(b1)=8.279 (from software; Fig. 33.10).
The distribution of sample slopes for the sorghum data, if the population slope is $\beta_1 = 0$.

FIGURE 33.11: The distribution of sample slopes for the sorghum data, if the population slope is β1=0.

The observed sample slope for the sorghum data is b1=101.4. Locating this value on Fig. 33.11 shows that it is very unlikely that any of the many possible samples would produce such a slope, just through sampling variation, if the population slope really was β1=0. The test statistic is found using the usual approach when the sampling distribution has an approximate normal distribution, using a t-score: t=observed valuemean of the distribution of the statisticstd deviation of the distribution of the statistic=b1β1s.e.(b1)=101.408.279=12.25, where the values of b1 and s.e.(b1) are taken from the software output (Fig. 33.10). This t-score is the same value reported by the software.

To determine if the statistic is consistent with the null hypothesis, the P-value can be approximated using the 68--95--99.7 rule, approximated using tables, or taken from software output (Fig. 33.10). Since t=12.25, the P-value will be very small; software shows the two-tailed P-value is P<0.001 (so the one-tailed P-value is P<0.0005).

We write:

The sample presents very strong evidence (t=11.23; one-tailed P<0.0005) that, in the population, the yield of sorghum decreases as infestation percentage increases (slope: 101.4; 95% CI from 84.3 to 118.6; n=24).

Notice the three features of writing conclusions: an answer to the RQ; evidence to support the conclusion (a t-score and P-value); and sample summary information (including a CI).

The P-value for a test of H0: ρ=0 will be the same as the P-value from a test of H0: β1=0. The test are effectively equivalent, both testing if the relationship observed in the sample can be explained by sampling variation.

Example 33.10 (Hypothesis testing) For the cyclone data (Example 33.7), the RQ is:

In the Australian region, is there a relationship between ONI and the number of cyclones?

This RQ implies these hypotheses: H0β1=0andH1β10. From the output (Fig. 33.8), t=5.52 and the P-value is small: P<0.0001. We write:

The sample presents very strong evidence (t=5.52; two-tailed P<0.0001) that, in the population, the number of cyclones is related to the ONI (slope: 2.23; 95% CI from 3.04 to 1.42; n=37).

33.5 Statistical validity conditions

As usual, these results hold under certain conditions. The conditions for which the CIs and tests are statistically valid are:

  1. The relationship is approximately linear (necessary for the (Pearson) correlation coefficient and regression line to be appropriate).
  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. The units of analysis are also assumed to be independent (e.g., from a simple random sample).

If the relationship non-linear but is increasing-only or decreasing-only, alternatives to the Pearson correlation coefficient include the Spearman or Kendall correlation coefficients (Conover 2003). Depending on which statistical validity conditions are not met, other regression-like options may be available. For example, generalised linear models (P. K. Dunn and Smyth 2018) may be appropriate for some non-linear relationships and/or relationships with non-constant variation in y.

Example 33.11 (Statistical validity) For the sorghum data, the scatterplot (Fig. 33.2, left panel) shows the relationship is approximately linear, so using a (Pearson) correlation coefficient and a regression line is appropriate. For the hypothesis test, the variation in yield doesn't seem to be obviously getting consistently larger or smaller for heavier infestations, and the sample size is only just smaller than 25 (with n=24). The CIs and tests are very likely to be statistically valid.

Example 33.12 (Cyclones) The scatterplot for the cyclone data (Fig. 33.6) shows the relationship is approximately linear, that the variation in the number of cyclones seems reasonably constant for different values of the ONI, and the sample size is larger than 25 (n=37). The CIs (Examples 33.1 and 33.9) and the tests (Example 33.2 and 33.10) are statistically valid.

33.6 Example: removal efficiency

In wastewater treatment facilities, air from biofiltration is passed through a membrane and dissolved in water, and is transformed into harmless by-products. The removal efficiency y (in %) may depend on the inlet temperature x (in C). Chitwood and Devinny (2001) asked:

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

The scatterplot of the n=32 observations was shown (and described) in Sect. 16.6, and repeated here (Fig. 33.12); the relationship is positive and approximately linear.

The output (Fig. 33.13) shows that the sample correlation coefficient is r=0.891 (with a 95% CI from 0.79 to 0.95), and so R2=(0.891)2=79.4%. This means that the unexplained variation in removal efficiency reduces by about 79.4% by knowing the inlet temperature.

The scatterplot showing the relationship between removal efficiency and inlet temperature.

FIGURE 33.12: The scatterplot showing the relationship between removal efficiency and inlet temperature.

The software output exploring the relationship between removal efficiency and inlet temperature.The software output exploring the relationship between removal efficiency and inlet temperature.

FIGURE 33.13: The software output exploring the relationship between removal efficiency and inlet temperature.

As always, the RQ is about the parameter, the correlation between the removal efficiency and inlet temperature in the population ρ. To test if a linear relationship exists in the population, write: H0ρ=0andH1ρ0. The alternative hypothesis is two-tailed (as implied by the RQ). The software output (Fig. 33.12, right panel) shows that P<0.001.

The scatterplot of the data (Fig. 33.12) shows the relationship is approximately linear, so a regression line is appropriate. From the software output (Fig. 33.13), b0=97.5 and b1=0.0757; hence ˆy=97.5+0.0757x for x and y defined above. The slope quantifies the relationship, so we can test H0β1=0andH1β10. From the output, t=10.7 which is huge; the P-value is small as expected: P<0.001. The output does not include the CI for the slope, but since s.e.(b1)=0.0070, the approximate 95% CI is 0.0757±(2×0.0070), or 0.0757±0.0140. We write:

Very strong evidence exists (t=10.7; P<0.001) that inlet temperature is linearly related to removal efficiency (slope: 0.0757; approximate 95% CI: 0.0616 to 0.0898).

The CI and test are statistically valid: the relationship is approximately linear, the variation in y is approximately constant for all values of x, and n=32.

33.7 Chapter summary

The CI for the correlation coefficient is found from software output. These steps are used to test a hypothesis about a correlation between two variables in the population, ρ.

  • Write the null hypothesis (H0: ρ=0) and the alternative hypothesis (H1); initially assume the value of ρ in the null hypothesis to be true (usually zero).
  • Find the P-value for the test from software.
  • Use the P-value to make a decision, and write a conclusion.
  • Check the statistical validity conditions.

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

Regression mathematically describes the relationship between two quantitative variables: the response variable y, and the explanatory variable x. The linear relationship between x and y (the regression equation), in the sample, is ˆy=b0+b1x, where b0 is a number (the intercept), b1 is a number (the slope), and the 'hat' above the y indicates that the equation gives a predicted mean value of y for a given x-value. Software provides the values of b0 and b1.

The intercept is the predicted mean value of y when the value of x is zero. The slope is how much the predicted mean value of y changes, on average, when the value of x increases by 1.

The regression equation can be used to make predictions or to understand the relationship between the two variables. Predictions made with values of x outside the values of x used to create the regression equation (called extrapolation) may not be reliable.

To compute a CI for the population slope of a regression equation β1, software provides the standard error of b1; then, the CI is b1±(multiplier×s.e.(b1)). The margin of error is (multiplier×standard error), where the multiplier is 2 for an approximate 95% CI (using the 68--95--99.7 rule).

These steps are used to test a hypothesis about a population slope β1:

  • Write the null hypothesis (H0: β1=0) and the alternative hypothesis (H1); initially assume the value of β1 in the null hypothesis to be true.
  • Describe the sampling distribution, which describes what to expect from the sample slope under this assumption: under certain statistical validity conditions, the sample slope varies with:
    • an approximate normal distribution,
    • with sampling mean whose value is β1=0 (from H0), and
    • having a standard deviation of s.e.(b1).
  • Compute the value of the test statistic: t=b1β1s.e.(b1), where b1 is sample slope.
  • The t-value is like a z-score, and so an approximate P-value can be approximated using the 68--95--99.7 rule, or found using software. Use the P-value to make a decision, and write a conclusion.
  • Check the statistical validity conditions.

33.8 Quick review questions

Telford and Cunningham (1991) examined the relationship between the height and weight of n=37 rowers at the Australian Institute of Sport (AIS; Fig. 33.14). The regression equation is ˆy=138+1.2x, and P<0.0001 for the two-tailed P-value for a test of the correlation.

Scatterplot of weight against height for rowers at the AIS.

FIGURE 33.14: Scatterplot of weight against height for rowers at the AIS.

Are the following statements true or false?

  1. The x-variable is the height of the rower.
  2. Since the P-value is small, the correlation is quite strong.
  3. The relationship is a positive relationship.
  4. Based on the scatterplot, 'weight of the rower' is considered the y-variable.
  5. Using the rise-over-run idea, a very rough estimate of the value of the slope is 1.2.
  6. The measurements units for the slope are kg.
  7. The measurements units for the intercept are kg.
  8. The standard error of the slope is 0.112, so the value of the test statistic to test if the population slope is zero is t=10.7.
  9. The P-value for this test will be very small.
  10. Predicting the mean weight of a 220cm-tall rower would be extrapolation.

Select the correct answer:

  1. What does the 'hat' above the y mean?
  2. What mean weight is predicted for a rower who is 180cm tall?
0 of 12 correct

33.9 Exercises

Answers to odd-numbered exercises are given at the end of the book.

Exercise 33.1 For each of the plots in Fig. 33.15, where appropriate:

  1. estimate the value of r (this is hard!).
  2. estimate the intercept of the regression line.
  3. estimate the slope of the regression line, using the rise-over-run idea.
  4. write down the estimated regression equation.
Four scatterplots.

FIGURE 33.15: Four scatterplots.

Exercise 33.2 [Dataset: Throttle] Amin and Mahmood-ul-Hasan (2019) measured the throttle angle (x) and the manifold air pressure (y), as a fraction of the maximum value, in gas engines.

  1. The value of r is given in the article as 0.972986604. Comment on this, and what it means.
  2. Comment on the use of a regression model, based on the scatterplot (Fig. 33.16; reconstructed from Amin and Mahmood-ul-Hasan (2019)).
  3. The authors fitted the following regression model: y=0.009+0.458x. Identify errors that the researchers have made when giving this regression equation.
  4. Critique the researchers' approach.
Manifold air pressure and throttle angle for an internal-combustion gas engine.

FIGURE 33.16: Manifold air pressure and throttle angle for an internal-combustion gas engine.

Exercise 33.3 In a correlation analysis, the researchers find that P=0.0002. Which (if any) of these statements are consistent with this P-value?

  1. r=0.89.
  2. r=0.891.

 

  1. r=0.04.
  2. r=0.06.

Exercise 33.4 In a correlation analysis, the researchers find that r=0.36. Which (if any) of these statements are consistent with this value of the correlation coefficient?

  1. The P-value is very small.
  2. The P-value is very large.

 

  1. The P-value is 0.36.
  2. The P-value is 0.362, or 13%.

Exercise 33.5 For each regression equation below, identify the values of b0 and b1.

  1. ˆy=3.50.14x.
  2. ˆy=0.0047x+2.1.

 

  1. ˆy=25.20.95x.
  2. ˆy=0.22x+0.15.

Exercise 33.6 For each regression equation below, identify the values of b0 and b1.

  1. ˆy=1.03+7.2x.
  2. ˆy=1.88x0.46.

 

  1. ˆy=201x+16.
  2. ˆy=3.04x0.032.

Exercise 33.7 Draw the regression line ˆy=5+2x for values of x between 0 and 10.

  1. Add some points to the scatterplot such that the correlation is approximately r=0.9.
  2. Add some more points to the scatterplot such that the correlation is approximately r=0.3.

Exercise 33.8 Draw the regression line ˆy=203x for values of x between 0 and 5.

  1. Add some points to the scatterplot such that the correlation is approximately r=0.95.
  2. Add some more points to the scatterplot such that the correlation is approximately r=0.2.

Exercise 33.9 LeBlanc et al. (2005) studied n=30 paramedicine students, using correlations to study 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.

  1. Write the hypotheses for testing if a relationship exists 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 33.10 Einsiedel et al. (2024) used correlations to study the relationship between amount of pesticide residue reported on a variety of fresh fruits and vegetables, and various weather measurements. One pesticide studied was perchlorate.

  1. Write the hypotheses for testing if a relationship exists between the perchlorate residue and maximum temperature at the growing location.
  2. The article gives the correlation coefficient as r=0.059 and P=0.035. What do you conclude?
  3. Write the hypotheses for testing if a relationship exists between the perchlorate residue and minimum temperature at the growing location.
  4. The article gives the correlation coefficient as r=0.025 and P=0.365. What do you conclude?
  5. What must be assumed for the tests to be statistically valid?

Exercise 33.11 [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. 33.17, left panel). To test if a linear relationship exists, are the statistical validity conditions met?

Exercise 33.12 [Dataset: Mandible] Royston and Altman (1994) examined the mandible length and gestational age for n=167 foetuses from the 12th week of gestation onward (Fig. 33.17, right panel). To test if a linear relationship exists, are the statistical validity conditions met?

Two scatterplots. Left: the time taken to deliver soft drinks to vending machines. Right: gestational age and mandible length. In both plots, the solid line displays the linear relationship.

FIGURE 33.17: Two scatterplots. Left: the time taken to deliver soft drinks to vending machines. Right: gestational age and mandible length. In both plots, the solid line displays the linear relationship.

Exercise 33.13 Heerfordt et al. (2018) studied the relationship between the time (in minutes) spent on sunscreen application x, and the amount (in g) of sunscreen applied y, using n=31 people. The fitted regression equation was ˆy=0.27+2.21x.

  1. Interpret the meaning of b0 and b1. Do they seem sensible?
  2. What are the units of measurement for the slope and intercept?
  3. According to the article, a hypothesis test for testing H0: β0=0 produced a P-value much larger than 0.05. What does this mean?
  4. For people who spend 8mins applying sunscreen, how much sunscreen would they use, on average?
  5. The article reports that R2=0.64. Interpret this value.
  6. What is the value of the correlation coefficient?

Exercise 33.14 Bhargava et al. (1985) stated (p. 1617):

In developing countries [...] logistic problems prevent the weighing of every newborn child. A study was performed to see whether other simpler measurements could be substituted for weight to identify neonates of low birth weight and those at risk.

One relationship they studied was between infant chest circumference (in cm) x and birth weight (in grams) y. The regression equation was given as: ˆy=3440.2403+199.2987x. The correlation coefficient was r=0.8696 with P<0.001.

  1. Critique the way in which the regression equation and correlation coefficient are reported.
  2. Based on the correlation information, could chest circumference be used as a useful predictor of birth weight? Explain.
  3. Interpret the intercept and the slope of the regression equation.
  4. What are the units of measurement for the intercept and slope?
  5. Predict the mean birth weight of an infant with a chest circumference of 30cm.

Exercise 33.15 [Dataset: Dogs] Quan, Tran, and Chung (2017) studied Phu Quoc Ridgeback dogs (Canis familiaris), and recorded many measurements of the dogs, including body length and body height. The scatterplot displaying this relationship and the software output are shown in Fig. 33.18. 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 in terms of correlations.
  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 length. Right: software output.Phu Quoc ridgeback dogs. Left: a scatterplot of the body height vs length. Right: software output.Phu Quoc ridgeback dogs. Left: a scatterplot of the body height vs length. Right: software output.

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

Exercise 33.16 [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). 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 and software output from 16 different soil samples from Assam, India, are shown in Fig. 33.19.

  1. Describe the plot in words
  2. Find and interpret the value of R2.
  3. Write down the CI for the correlation coefficient.
  4. Conduct a hypothesis test for ρ.
  5. Would the test be statistically valid?
The relationship between CBR and PI in $16$ soil samples. Left: scatterplot. Right: software output.The relationship between CBR and PI in $16$ soil samples. Left: scatterplot. Right: software output.The relationship between CBR and PI in $16$ soil samples. Left: scatterplot. Right: software output.

FIGURE 33.19: The relationship between CBR and PI in 16 soil samples. Left: scatterplot. Right: software output.

Exercise 33.17 [Dataset: OSA] de Carvalho et al. (2020) studied obstructive sleep apnoea (OSA) in 60 adults with Down Syndrome. The response variable y is OSA severity. The explanatory variable x is the average number of episodes of sleep disruption (according to specific criteria) per hour of sleep, the Respiratory Event Index (REI). One RQ is:

Among Down Syndrome adults, is there a linear relationship between REI and neck size?

The data are plotted in Fig. 33.20 (left panel).

  1. Using the software output (Fig. 33.20), determine the value of r.
  2. Interpret the value of R2.
  3. Write down the values of the intercept and the slope, and hence the regression equation.
  4. Explain what the slope in the regression equation means.
  5. Find an approximate 95% CI for the slope.
  6. Perform a hypothesis to test if a relationship exists between the variables.
  7. Are the test and CI statistically valid?
Neck circumference vs REI for Down Syndrome adults. Left: scatterplot. Right: software output.Neck circumference vs REI for Down Syndrome adults. Left: scatterplot. Right: software output.

FIGURE 33.20: Neck circumference vs REI for Down Syndrome adults. Left: scatterplot. Right: software output.

FIGURE 33.21: The obstructive sleep apnoea dataset.

Exercise 33.18 [Dataset: EDpatients] Brunette, Kominsky, and Ruiz (1991) studied the relationship between the number of emergency department (ED) patients and the number of days following the distribution of monthly welfare monies, from 1986 to 1988 in Minneapolis, MN (Fig. 33.22).

  1. Write down the estimated regression equation.
  2. Interpret the slope in the regression equation.
  3. Find an approximate 95% CI for the slope.
  4. Conduct a hypothesis test for the slope, and explain what the result means.
  5. What is the value of the correlation coefficient?
The number of emergency department patients, and the number of days since distribution of welfare. Left: scatterplot. Right: software output.The number of emergency department patients, and the number of days since distribution of welfare. Left: scatterplot. Right: software output.

FIGURE 33.22: The number of emergency department patients, and the number of days since distribution of welfare. Left: scatterplot. Right: software output.

Exercise 33.19 [Dataset: Bitumen] Panda, Das, and Sahoo (2018) made n=42 observations of hot mix asphalt, and measured the volume of air voids and the bitumen content by weight (Fig. 33.23).

  1. Describe the plot in words.
  2. For the data, R2=99.29%. Determine, and interpret, the value of r.
  3. Write down the regression equation using the software output.
  4. Interpret what the regression equation means.
  5. Perform a test to determine if there is a relationship between the variables.
  6. What is the P-value for testing H0: ρ=0?
  7. Predict the mean percentage of air voids by volume when the percentage bitumen is 5.0%. Do you expect this to be a good prediction? Why or why not?
  8. Predict the mean percentage of air voids by volume when the percentage bitumen is 6.0%. Do you expect this to be a good prediction?
  9. Would the test be statistically valid?
Air voids in bitumen. Left: scatterplot. Right: software outputAir voids in bitumen. Left: scatterplot. Right: software output

FIGURE 33.23: Air voids in bitumen. Left: scatterplot. Right: software output

Exercise 33.20 [Dataset: Possums] J. L. Williams et al. (2022) studied Leadbeater's possums in the Victorian Central Highlands. They recorded, among other information, the body weight of the possums (in g) and their location, including the elevation (in m; DEM), as shown in Fig. 33.24.

  1. The value of R2 is 23.0%. Determine, and interpret, the value of r.
  2. Write down the regression equation.
  3. Determine if there is a relationship between the possum weight and the elevation.
  4. What is the P-value for a test of H0: ρ=0?
  5. Interpret the meaning of the slope.
  6. Predict the mean weight of male possums at an elevation of 1000m. Do you expect this to be a good prediction? Why or why not?
  7. Predict the mean weight of male possums at an elevation of 200m. Do you expect this to be a good prediction? Why or why not?
The relationship between weight of possums and the elevation of their location. Left: scatterplot. Right: software output.The relationship between weight of possums and the elevation of their location. Left: scatterplot. Right: software output.

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

Exercise 33.21 [Dataset: Gorillas] Wright et al. (2021) examined 25 gorillas and recorded their chest-beating rates and size (the breadth of the gorillas' backs). The relationship is shown in Fig. 33.25. Use the software output (Fig. 33.26) to study the relationship.

  1. Determine the value of r and R2.
  2. Perform a hypothesis test for the slope, and write a conclusion.
  3. Find the regression equation.
The scatterplot for the chest-beating data.

FIGURE 33.25: The scatterplot for the chest-beating data.

Software regression output for the gorilla data.Software regression output for the gorilla data.

FIGURE 33.26: Software regression output for the gorilla data.

Exercise 33.22 [Dataset: Corollas] On 25 June 2014, I searched Gum Tree (an Australian online marketplace), for Toyota Corolla in the 'Cars, Vans & Utes' category. I recorded the age and the price of each (second-hand) car from the first two pages of results that were returned.

I restricted the data to cars less than 14 years old at the time, removed one 13-year-old Corolla advertised for sale for $390000, then produced the scatterplot in Fig. 33.27 (left panel).

The price of second-hand Toyota Corollas (\(n = 38\)) as advertised on Gum Tree on 25 June 2014, plotted against age (left) and year of manufacture (right).

FIGURE 33.27: The price of second-hand Toyota Corollas (n=38) as advertised on Gum Tree on 25 June 2014, plotted against age (left) and year of manufacture (right).

  1. Describe the relationship displayed in the graph, in words.
  2. What else could influence the price of a second-hand Corolla besides the age?
  3. Consider a seven-year-old Corolla selling for $15000. Would this be cheap or expensive? Explain.
  4. As stated, I removed one observation: a 13-year-old Corolla for sale at $390000. What do you think the price was meant to be listed as, by looking at the scatterplot? Explain.
  5. From the scatterplot, draw (if you can), or estimate by eye, an approximation of the regression line. Then, estimate the value of b0 (the intercept) from the line you drew. What does this mean? Do you think this value is meaningful?
  6. Estimate the value of b1 (the slope) from the line you drew. What does this mean? Do you think this value is meaningful?
  7. From the line you drew above, write down an estimate of the regression equation.
  8. What are the units of the intercept and the slope?
  9. Use the software output (Fig. 33.28) relating the price (in thousands of dollars) to age to write down the regression equation.
  10. Using the software output, write down the value of r. Using this value of r, compute the value of R2. What does this mean?
The jamovi output, analysing the Corolla dataThe jamovi output, analysing the Corolla data

FIGURE 33.28: The jamovi output, analysing the Corolla data

  1. Use the regression equation from the software output to estimate the sale price of a Corolla that is 20-years-old, and explain your answer.

  2. Using the software output, perform a suitable hypothesis test to determine if there is evidence that lower prices are associated with older Corollas.

  3. Compute an approximate 95% CI for the population slope (use the software output).

  4. I could have drawn a scatterplot with Price on the vertical axis and Year of manufacture on the horizontal axis (Fig. 33.27, right panel). For this graph:

    1. What is the value of the correlation coefficient?
    2. How would the value of R2 change (if at all)?
    3. How would the value of the slope change (if at all)?
    4. How would the value of the intercept change (if at all)?

Exercise 33.23 [Dataset: Elephants] Weighing elephants is not easy due to their size. Height (to the shoulder) is easier to measure, and may be a useful proxy for the mass (Lalande et al. 2022a). Two scatterplots of some relevant data (Lalande et al. 2022b) are shown in Fig. 33.29.

  1. Which graph do you think is for males and which for female elephants? Explain.
  2. Which plot has a correlation coefficient closest to one? Explain.
  3. Use software to find the correlation coefficients for each sex.
  4. For which sex is the height likely to be better for estimating mass? Explain.
  5. Use software to find the regression equations for predicting mass from height (one for each sex).
  6. Test to confirm the relationship between mass and height, for each sex.
  7. Use the regression lines to predict the mass of an elephant with a height of 225m, for each sex.
  8. Discuss the statistical validity conditions.
Mass and height of elephants.

FIGURE 33.29: Mass and height of elephants.

Exercise 33.24 [Dataset: Jeans] Diehm and Thomas (2018) recorded data on the size of front pockets in men's and women's jeans. This exercise considers the correlation between the maximum widths and maximum heights of front pockets (Fig. 33.30).

  1. The correlation for all jeans is r=0.38, with P=0.00051. What does this mean?
  2. For men's jeans only, the correlation is r=0.09, with P=0.59. What does this mean?
  3. For women's jeans only, the correlation is r=0.14, with P=0.38. What does this mean?
  4. Compute the means for both variables for the combined data, for men's jeans only, and for women's jeans only.
  5. From the last four questions, how would you describe the relationship between the maximum widths and maximum heights of the front pockets of jeans?
The relationships between minimum and maximum heights of front pockets for all jeans (left), men's jeans only (centre) and women's jeans only (right).

FIGURE 33.30: The relationships between minimum and maximum heights of front pockets for all jeans (left), men's jeans only (centre) and women's jeans only (right).

Exercise 33.25 [Dataset: DogsLife] The DogsLife dataset gives the average breed weight and average breed lifetime for 73 breeds of dogs. Determine if a relationship exists between breed weight and breed lifetime.

Exercise 33.26 [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 linear relationship between a person's mean typing speed and mean accuracy? Explain.


For those interested: the value of r only varies between 1 and 1, so cannot have a normal distribution. A transformation of r does exist that has an approximate normal distribution and standard error.

For those interested: the 'line of best fit' is the line for which the sum of the squared vertical distances between the observations y and the predicted values ˆy (i.e, the regression line) is as small as possible.

A 'percentage point' increase means a change from, say, 10% to 11%, or 35% to 36%.