Chapter33Correlation and regression: CIs and tests
Objectives
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:
A diagram showing the six steps of research, arranged in a cycle: Ask, Design, Collect, Classify and summarise, Analyse, Report. Step 5 (Analyse) is highlighted, captioned βCorrelation, Regression: CIs and testsβ.
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.
[203] recorded the borer infestation in sorghum crops, for \(n = 24\) crops over three years [204], shown in Fig. FigureΒ 33.1. The data comprises two quantitative variables (Fig. FigureΒ 33.3, left panel).
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. FigureΒ 33.3, right panel) is \(r = -0.934\text{,}\) so \(R^2 = (-0.934)^2 = 87.2\)%. This means that the unexplained variation in yield reduces by \(78.8\)% by knowing the amount of infestation.
The sorghum data in Fig. FigureΒ 33.1 is only one of the countless possible samples of sorghum crops that could have been studied. The value of \(r\) (an estimate of \(\rho\text{,}\) the parameter) will vary from sample to sample; that is, the value of \(r\) has a sampling distribution, and sampling variation exists. The sampling distribution of \(r\text{,}\) however, does not have a normal distribution, so CIs for \(\rho\) will be taken directly from software output (Fig. FigureΒ 33.3, right panel). For the sorghum data, the \(95\)% CI for \(\rho\) is from \(-0.971\) to \(-0.851\text{.}\) This CI is not symmetrical: the value of \(r\) is not halfway between these limits. We write:
For soghum crops, the correlation coefficient between yield and infestation percentage is \(-0.934\text{,}\) with a \(95\)% CI from \(-0.971\) to \(-0.851\) (\(n = 24\)).
In other words, a population with a correlation coefficient \(\rho\) between \(-0.971\) and \(-0.851\) could reasonably have produced a sample correlation coefficient of \(r = -0.934\) from a sample of size \(n = 24\text{.}\)
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. FigureΒ 33.5 (left panel) [143].
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\text{.}\)
Figure33.5.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.
A hypothesis test can also be conducted regarding \(\rho\text{,}\) 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:
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 \(\rho\text{.}\)
As usual, initially assume that \(\rho = 0\) (from \(H_0\)), 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.β1β
For those interested: the value of \(r\) only varies between \(-1\) and \(1\text{,}\) so cannot have a normal distribution. A transformation of \(r\)does exist that has an approximate normal distribution and standard error.
However, the output (Fig. FigureΒ 33.3, right panel) contains the relevant two-tailed \(P\)-value for the test: less than \(0.001\text{.}\) Hence, the one-tailed \(P\)-value for the test is less than \(0.0005\text{.}\)Very strong evidence exists to support \(H_1\) (that the correlation in the population is negative).
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\text{;}\)\(n = 24\)) in the population.
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.
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. FigureΒ 33.5 (left panel). To test for a relationship, use
software reports that \(P < 0.0001\) (Fig. FigureΒ 33.5, 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).
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.
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\text{,}\) is
The notation \(\hat{y}\) refers to the mean of all the \(y\)-values that could be observed for some given value of \(x\text{.}\) That is, for some value of \(x\text{,}\) many different values of \(y\) could be observed, and \(\hat{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\text{.}\)
\(y\) refers to the values of the response variable observed from individuals. \(\hat{y}\) refers to predicted mean value of \(y\) for given values of \(x\text{.}\)
where the values of \(b_0\) and \(b_1\) are unknown, and estimated from sample data. Notice that \(b_1\) is the number multiplied by \(x\text{.}\) In Equation (33.1), \(b_0 = -4\) and \(b_1 = 2\text{.}\)
A report on the growth of Australian children [88] 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
In both cases, \(b_0 = 73\) and \(b_1 = 7\text{.}\) This regression equation describes the connection between ages \(x\) and heights \(y\) for girls aged between four and seven.
To introduce, or revise, the idea of a linear equation, consider the (artificial) data in Fig. FigureΒ 33.10, with an explanatory variable \(x\) and a response variable \(y\text{.}\) In the graph, a sensible line is drawn on the graph that seems to capture the relationship between \(x\) and \(y\text{.}\) (You may have drawn a slightly different, but similar, line.) The line describes the predicted mean values of \(y\) (i.e., values of \(\hat{y}\)) for various values of \(x\text{.}\) The relationship is positive and linear.
A regression equation specifies the line. In the regression equation \(\hat{y} = b_0 + b_1 x\text{,}\) the numbers \(b_0\) and \(b_1\) are called regression coefficients, where
We will use software to find the values of \(b_0\) and \(b_1\) (as the formulas are tedious to use). However, a rough approximation of the values of \(b_0\) and \(b_1\) can be obtained using the rough straight line drawn on the scatterplot (Fig. FigureΒ 33.10).
A rough approximation of the value of the intercept\(b_0\) is the value of \(\hat{y}\) when \(x = 0\text{,}\) from the drawn line. When \(x = 0\text{,}\) the regression line suggests the value of \(\hat{y}\) is about \(2\text{;}\) that is, the value of \(b_0\) is approximately \(2\text{.}\)
\begin{equation}
\frac{\text{Change in } \hat{y}}{\text{Corresponding increase in } x} = \frac{\text{rise}}{\text{run}}\tag{33.2}
\end{equation}
from the drawn line. This approximation of the slope is the change in the value of \(\hat{y}\) (the βriseβ) divided by the corresponding increase in the value of \(x\) (the βrunβ).
Consider what happens in the animation below (Fig. FigureΒ 33.11) when the value of \(x\) increases from \(1\) to \(5\) (a run of \(5 - 1 = 4\)). The corresponding value of \(y\) changes from about \(5\) to about \(17\text{,}\) a rise of \(17 - 5 = 12\text{.}\) So, using Equation (33.2),
An animation showing the regression line for the example scatterplot, with the run and rise between two points, and the resulting slope, marked progressively.
The value of \(b_1\) is about \(3\text{.}\) When using rise-over-run, better guesses for \(b_1\) 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\)).
The regression equation has \(\hat{y}\) (not \(y\)) on the left-hand side. That is, the equation predicts the mean values of \(y\text{,}\) which may not be equal to any of the observed values (which are denoted by \(y\)).
A βgoodβ regression equation would produce predicted values \(\hat{y}\) close to the observed values \(y\text{;}\) that is, the line passes close to each point on the scatterplot.
The intercept\(b_0\) has the same measurement units as the response variable. The measurement units for the slope\(b_1\) is the βmeasurement units of the response variableβ, per βmeasurement units of the explanatory variableβ.
Example33.13.Measurement units of regression parameters.
In Example ExampleΒ 33.9, the regression line for the relationship between the age of Australian girls \(x\) (in years) and their height (in cm) \(y\) was \(\hat{y} = 73 + 7x\) (for girls aged between four and seven years).
Example33.14.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 \(b_0\) and \(b_1\) (Fig. FigureΒ 33.15). The estimate of \(b_0\) (the value of \(\hat{y}\) when \(x = 0\)) is roughly \(4\,800\kgs.\xhas^{-1}\text{.}\)
The estimate of \(b_1\) can be found using the rise-over-run idea. When \(x = 0\text{,}\) the value of \(\hat{y}\) (according to the drawn line) is about \(4\,800\text{.}\) At the other extreme of the plot, where \(x = 40\text{,}\) the value of \(\hat{y}\) is about \(1\,000\text{.}\) (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\text{,}\) the value of \(\hat{y}\)reduces from about \(4\,800\) to about \(1\,000\text{,}\) a change of about \(-3\,800\text{.}\) That is, for a βrunβ of \(40 - 0 = 40\text{,}\) the βriseβ is \(4\,800 - 1\,000 = -3\,800\) (i.e., a drop of \(3\,800\)), and so a rough estimate of the slope is \(-3\,800/40 = -95\text{.}\) (The relationship is negative, so the slope is negative.)
where \(x\) is the infestation percentage, and \(y\) is yield (in \(\kgs.\xhas^{-1}\)). The rough guess of the intercept \(b_0\) is \(4\,800\kgs.\xhas^{-1}\text{,}\) while the rough guess of the slope \(b_1\) is \(-95\kgs.\xhas^{-1}/\%\text{.}\)
Figure33.15.Obtaining rough guesses for the regression equation for the sorghum data. Left: approximating \(b_0\text{.}\) Right: approximating \(b_1\) using rise-over-run. The plus signs on the right plot indicate the points used to estimate the slope.
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. FigureΒ 33.5 (left panel).
To make a guess of the regression coefficients, a sensible line can be drawn through the data (Fig. FigureΒ 33.17). When the value of \(x\) is zero, the predicted value of \(y\) is about \(12\text{,}\) so \(b_0\) is about \(12\) cyclones. Recall: the intercept is the predicted value of \(y\) when \(x = 0\text{,}\) which is not at the left of the graph in Fig. FigureΒ 33.17.
To approximate the value of \(b_1\text{,}\) use the rise-over-run idea. When \(x = -2\text{,}\) the predicted mean value of \(y\) is about \(17\text{;}\) when \(x = 2\text{,}\) the predicted mean value of \(y\) is about \(8\text{.}\) The value of \(x\) increases by \(2 - (-2) = 4\text{,}\) while the value of \(\hat{y}\) changes by \(7.5 - 17 = -9.5\) (a decrease of about \(9.5\)). Hence, \(b_1\) 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.)
Figure33.17.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 regression line is shown. The plus sign \(+\) is located on the line where \(x = 0\text{.}\) The crosses \(\times\) are located to find rise-over-run.
The above method gives a crude approximation to the values of the intercept \(b_0\) and the slope \(b_1\text{.}\) In practice, many reasonable lines could be drawn through a scatterplot of data, each giving slightly different rough guesses for \(b_0\) and \(b_1\text{.}\) However, one of those lines is the βbestβ line in some sense,β2β
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 \(\hat{y}\) (i.e, the regression line) is as small as possible.
and is sometimes called the βline of best fitβ.
Subsection33.3.3Regression: finding equations using software
Software is almost always used to find the estimates for the intercept \(b_0\) and slope \(b_1\text{,}\) as the formulas are complicated and tedious to use. For the sorghum data (Fig. FigureΒ 33.3), the relevant software output is shown in Fig. FigureΒ 33.19.
In the output, the values of \(b_0\) and \(b_1\) are in the column labelled Estimate; the value of the sample \(y\)-intercept is \(b_0 = 4\,814.1\kgs.\xhas^{-1}\text{,}\) and the value of the sample slope is \(b_1 = -101.4\kgs.\xhas^{-1}/\%\text{.}\) These are the values of the two regression coefficients. The regression equation is, after rounding:
These are close to the values obtained using the rough method in Sect. SubsectionΒ 33.3.2 (which gave \(b_0 = 4\,800\) and \(b_1 = -95\) approximately).
The sign of the slope \(b_1\) 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.
where \(x\) is the ONI (averaged over October, November, December) and \(y\) is the number of cyclones; that is, \(b_0 = 12.1\) cyclones and \(b_1 = -2.23\) cyclones per unit change in ONI. These values are close to the approximations made in Example ExampleΒ 33.16 (\(b_0 = 12\) and \(b_1 = -2.375\) respectively).
Regression equations can be used to make predictions of the mean value of \(y\) for a given value of \(x\text{.}\) 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\%\text{.}\) Since \(x\) represents the infestation percentage, use \(x = 30\) in the regression equation:
Crops with an infestation percentage of \(30\%\) are predicted to have a mean yield of \(1\,772.1\kgs.\xhas^{-1}\) (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 \(1\,772.1\kgs.\xhas^{-1}\text{.}\)
The value of \(\hat{y}\) is computed using the estimates \(b_0\) and \(b_1\text{,}\) which are computed from sample data. Hence, the value of \(\hat{y}\) also depends on which one of the countless possible samples is used. This means that \(\hat{y}\) also has a sampling distribution and a standard error.
or about \(-256\kgs.\xhas^{-1}\text{,}\) which is clearly silly (negative yields are impossible). In the data, the heaviest infestation is about \(40\%\text{,}\) so no data exists beyond a \(40\%\) infestation percentage. As a result, the regression line does not even apply for infestations exceeding \(40\%\text{.}\) (This means that the relationship must be non-linear after \(40\%\text{.}\))
Making predictions outside the range of the available data is called extrapolation, and extrapolation beyond the data may lead to nonsense predictions.
The regression equation (Example ExampleΒ 33.9) used to predict the mean height of girls \(\hat{y}\) from their age \(x\) (for girls aged between four and seven) was given as
The heights of girls will vary around a mean height of \(108\cms\text{;}\) some individual girls aged five will be taller than \(108\cms\text{,}\) and some will be shorter than \(108\cms\text{.}\)
Using the equation to estimate the height of girls aged \(21\) would predict a mean height of \(220\cms\text{.}\) However, this is extrapolation and the prediction is nonsense. Young children grow at a fast rate, but growth rate slows as children age.
for crops with an infestation of zero; this is the value of \(b_1\text{.}\) Sometimes, using \(x = 0\) is extrapolating, as no data exists near \(x = 0\text{,}\) so sometimes this interpretation of \(b_0\) produces nonsense.
The value of the intercept \(b_0\) is sometimes (but not always) meaningless. The value of the slope \(b_1\) is usually of greater interest, as it explains the relationship between the two variables.
The slope \(b_1\) quantifies how the value of \(\hat{y}\) changes (on average) when the value of \(x\)increases by one (Sect. SubsectionΒ 33.3.3). For the sorghum data, \(b_1\) is the change in predicted mean yield for each percentage pointβ3β
A βpercentage pointβ increase means a change from, say, \(10\)% to \(11\)%, or \(35\)% to \(36\)%.
Specifically, each extra percentage point of borer infestation is associated with a mean change in yield of \(-101.4\kgs.\xhas^{-1}\) (from Equation (33.4)); that is, a decrease in yield by a mean of \(101.4\kgs.\xhas^{-1}\) for each extra percentage point of infestation.
To demonstrate, consider the case where \(x = 10\text{,}\) when the regression equation predicts \(\hat{y} = 3\,800.1\kgs.\xhas^{-1}\text{.}\) For infestations one percentage point greater than this (i.e., \(x = 11\)), the value of the prediction \(\hat{y}\) will increase by an average of \(-101.4\kgs.\xhas^{-1}\) (or, equivalently, decrease by an average of \(101.4\kgs.\xhas^{-1}\)). That is, we would predict \(\hat{y} = 3\,800.1 - 101.4 = 3\,698.7\kgs.\xhas^{-1}\text{.}\) This is the same prediction made by using \(x = 11\) in Equation (33.4).
If the value of \(b_1\) is positive, then the predicted mean values of \(y\)increase as the values of \(x\)increase. If the value of \(b_1\) is negative, then the predicted mean values of \(y\)decrease as the values of \(x\)increase.
This interpretation of \(b_1\) explains the relationship: the predicted mean yield is, on average, about \(101.4\kgs.\xhas^{-1}\) 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 \(\hat{y}\text{.}\) Unless the study is experimental, we cannot say that the change in the value of \(x\)causes the change in the value of \(\hat{y}\text{.}\)
If the value of the slope is zero, there is no linear relationship between \(x\) and \(\hat{y}\text{.}\) A slope of zero means that a change in the value of \(x\) is associated with a change of zero in the value of \(\hat{y}\text{.}\) In this case, the correlation coefficient is also zero.
Section33.4Regression: CIs and \(t\)-test for regression parameters
Subsection33.4.1Introduction
A regression equation exists in the population that connects the values of \(x\) and \(\hat{y}\text{.}\) 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 \(\beta_0\) and the slope by \(\beta_1\text{.}\) The values of the parameters \(\beta_0\) and \(\beta_1\) are unknown, and are estimated by the statistics \(b_0\) and \(b_1\) respectively.
Every sample is likely to produce slightly different values for both \(b_0\) and \(b_1\) (sampling variation), so both \(b_0\) and \(b_1\) have a sampling distribution and a standard error. The formulas for computing the values of \(b_0\) and \(b_1\) (and their standard errors) are intimidating, so we will use software to perform the calculations. The sampling distributions for \(b_0\) and \(b_1\) have approximate normal distributions under certain conditions (Sect. SectionΒ 33.5).
Usually the slope is of greater interest than the intercept, because the slope explains the relationship between the two variables (Sect. SubsectionΒ 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.
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. FigureΒ 33.30) as, using Def. DefinitionΒ 33.29:
Software can be used to produce exact CIs too; the exact \(95\)% CI is from \(-118.6\) to \(-84.3\kgs.\xhas^{-1}\) (Fig. FigureΒ 33.31). 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.4\kgs.\xhas^{-1}\) (\(95\)% CI: \(-118.6\) to \(-84.3\text{;}\)\(n = 24\)).
For each increase of one percentage point in borer infestation, the mean yield decreases by \(101.4\kgs.\xhas^{-1}\) (\(95\)% CI: \(84.3\) to \(118.6\text{;}\)\(n = 24\)).
Using the software output (Fig. FigureΒ 33.21) for the cyclone data, \(\text{s.e.}(b_1) = 0.404\text{,}\) so the approximate \(95\)% CI for the regression slope \(\beta_1\) is
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. FigureΒ 33.21.
Subsection33.4.3Regression: \(t\)-tests for regression parameters
Since the regression line describing the relationship between \(x\) and \(\hat{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., \(\beta_1 = 0\)). In other words, a hypothesis test can be conducted for the slope to determine if sampling variation can explain the discrepancy between \(\beta_1\) and \(b_1\text{.}\) (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. SubsectionΒ 33.3.5), so the null hypothesis (about the population) is \(H_0\text{:}\)\(\beta_1 = 0\text{.}\) A slope of \(\beta_1 = 0\) is equivalent to no relationship between the variables. (We would also find \(\rho = 0\text{.}\))
The parameter is \(\beta_1\text{,}\) 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 \(\beta_1 = 0\)), the possible values of the sample slope \(b_1\) can be described (Def. DefinitionΒ 33.29).
A normal distribution curve centred at zero with standard error 8.279, showing the sampling distribution of the sample slope under the null hypothesis.
The observed sample slope for the sorghum data is \(b_1 = -101.4\text{.}\) Locating this value on Fig. FigureΒ 33.33 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 \(\beta_1 = 0\text{.}\) The test statistic is found using the usual approach when the sampling distribution has an approximate normal distribution, using a \(t\)-score:
\begin{align*}
t \amp= \frac{\text{observed value} - \text{mean of the distribution of the statistic}}{\text{std deviation of the distribution of the statistic}}\\\\
\amp= \frac{ b_1 - \beta_1}{\text{s.e.}(b_1)} = \frac{-101.4 - 0}{8.279} = -12.25,
\end{align*}
where the values of \(b_1\) and \(\text{s.e.}(b_1)\) are taken from the software output (Fig. FigureΒ 33.31). 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. FigureΒ 33.31). Since \(t = -12.25\text{,}\) 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\)).
The sample presents very strong evidence (\(t = -11.23\text{;}\) one-tailed \(P < 0.0005\)) that, in the population, the yield of sorghum decreases as infestation percentage increases (slope: \(-101.4\text{;}\)\(95\)% CI from \(-84.3\) to \(-118.6\text{;}\)\(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 \(H_0\text{:}\)\(\rho = 0\) will be the same as the \(P\)-value from a test of \(H_0\text{:}\)\(\beta_1 = 0\text{.}\) The test are effectively equivalent, both testing if the relationship observed in the sample can be explained by sampling variation.
The sample presents very strong evidence (\(t = -5.52\text{;}\) two-tailed \(P < 0.0001\)) that, in the population, the number of cyclones is related to the ONI (slope: \(-2.23\text{;}\)\(95\)% CI from \(-3.04\) to \(-1.42\text{;}\)\(n = 37\)).
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 [86]. Depending on which statistical validity conditions are not met, other regression-like options may be available. For example, generalised linear models [143] may be appropriate for some non-linear relationships and/or relationships with non-constant variation in \(y\text{.}\)
For the sorghum data, the scatterplot (Fig. FigureΒ 33.3, 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.
The scatterplot for the cyclone data (Fig. FigureΒ 33.17) 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 ExampleΒ 33.4 and ExampleΒ 33.32) and the tests (Example ExampleΒ 33.7 and ExampleΒ 33.35) are statistically valid.
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 \({}^\circ\)C). [147] asked:
The scatterplot of the \(n = 32\) observations was shown (and described) previously, and repeated here (Fig. FigureΒ 33.38); the relationship is positive and approximately linear.
The output (Fig. FigureΒ 33.39) shows that the sample correlation coefficient is \(r = 0.891\) (with a \(95\)% CI from \(0.79\) to \(0.95\)), and so \(R^2 = (0.891)^2 = 79.4\)%. This means that the unexplained variation in removal efficiency reduces by about \(79.4\)% by knowing the inlet temperature.
As always, the RQ is about the parameter, the correlation between the removal efficiency and inlet temperature in the population \(\rho\text{.}\) To test if a linear relationship exists in the population, write:
The alternative hypothesis is two-tailed (as implied by the RQ). The software output (Fig. FigureΒ 33.38, right panel) shows that \(P < 0.001\text{.}\)
The scatterplot of the data (Fig. FigureΒ 33.38) shows the relationship is approximately linear, so a regression line is appropriate. From the software output (Fig. FigureΒ 33.39), \(b_0 = 97.5\) and \(b_1 = 0.0757\text{;}\) hence
From the output, \(t = 10.7\) which is huge; the \(P\)-value is small as expected: \(P < 0.001\text{.}\) The output does not include the CI for the slope, but since \(\text{s.e.}(b_1) = 0.0070\text{,}\) the approximate\(95\)% CI is
Very strong evidence exists (\(t = 10.7\text{;}\)\(P < 0.001\)) that inlet temperature is linearly related to removal efficiency (slope: \(0.0757\text{;}\) 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\text{,}\) and \(n = 32\text{.}\)
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, \(\rho\text{.}\)
Write the null hypothesis (\(H_0\text{:}\)\(\rho = 0\)) and the alternative hypothesis (\(H_1\)); initially assume the value of \(\rho\) in the null hypothesis to be true (usually zero).
Regression mathematically describes the relationship between two quantitative variables: the response variable \(y\text{,}\) and the explanatory variable \(x\text{.}\) The linear relationship between \(x\) and \(y\) (the regression equation), in the sample, is
where \(b_0\) is a number (the intercept), \(b_1\) 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 \(b_0\) and \(b_1\text{.}\)
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\text{.}\)
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 \(\beta_1\text{,}\) software provides the standard error of \(b_1\text{;}\) then, the CI is
The margin of error is (multiplier\({}\times{}\)standard error), where the multiplier is \(2\) for an approximate \(95\)% CI (using the \(68\)β\(95\)β\(99.7\) rule).
Write the null hypothesis (\(H_0\text{:}\)\(\beta_1 = 0\)) and the alternative hypothesis (\(H_1\)); initially assume the value of \(\beta_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:
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.
[126] examined the relationship between the height and weight of \(n = 37\) rowers at the Australian Institute of Sport (AIS; Fig. FigureΒ 33.40). The regression equation is \(\hat{y} = -138 + 1.2 x\text{,}\) and \(P < 0.0001\) for the two-tailed \(P\)-value for a test of the correlation.
The standard error of the slope is \(0.112\text{,}\) so the value of the test statistic to test if the population slope is zero is \(t = 10.7\text{.}\) [True]
[Dataset: Throttle] [358] measured the throttle angle (\(x\)) and the manifold air pressure (\(y\)), as a fraction of the maximum value, in gas engines.
The authors fitted the following regression model: \(y = 0.009 + 0.458x\text{.}\) Identify errors that the researchers have made when giving this regression equation.
In a correlation analysis, the researchers find that \(r = 0.36\text{.}\) Which (if any) of these statements are consistent with this value of the correlation coefficient?
[372] 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.
[369] 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.
[Dataset: SDrink] A study examined the time taken to deliver soft drinks to vending machines [153] using a sample of size \(n = 25\) (Fig. FigureΒ 33.43, left panel). To test if a linear relationship exists, are the statistical validity conditions met?
[Dataset: Mandible] [154] examined the mandible length and gestational age for \(n = 167\) foetuses from the \(12\)th week of gestation onward (Fig. FigureΒ 33.43, right panel). To test if a linear relationship exists, are the statistical validity conditions met?
Figure33.43.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.
[221] studied the relationship between the time (in minutes) spent on sunscreen application \(x\text{,}\) and the amount (in g) of sunscreen applied \(y\text{,}\) using \(n = 31\) people. The fitted regression equation was \(\hat{y} = 0.27 + 2.21x\text{.}\)
According to the article, a hypothesis test for testing \(H_0\text{:}\)\(\beta_0 = 0\) produced a \(P\)-value much larger than \(0.05\text{.}\) What does this mean?
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\text{.}\) The regression equation was given as:
[Dataset: Dogs] [71] 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. FigureΒ 33.44. In this example, it does not matter which variable is used as \(x\) or \(y\text{.}\)
[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). [375] 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. FigureΒ 33.45.
[Dataset: OSA] [362] 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:
[Dataset: EDpatients] [361] 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. FigureΒ 33.48).
Figure33.48.The number of emergency department patients, and the number of days since distribution of welfare. Left: scatterplot. Right: software output.
[Dataset: Bitumen] [368] made \(n = 42\) observations of hot mix asphalt, and measured the volume of air voids and the bitumen content by weight (Fig. FigureΒ 33.49).
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?
[Dataset: Possums] [29] 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. FigureΒ 33.50.
[Dataset: Gorillas] [107] examined \(25\) gorillas and recorded their chest-beating rates and size (the breadth of the gorillasβ backs). The relationship is shown in Fig. FigureΒ 33.51. Use the software output (Fig. FigureΒ 33.52) to study the relationship.
[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 \(\$390\,000\text{,}\) then produced the scatterplot in Fig. FigureΒ 33.53 (left panel).
Figure33.53.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).
As stated, I removed one observation: a \(13\)-year-old Corolla for sale at \(\$390\,000\text{.}\) What do you think the price was meant to be listed as, by looking at the scatterplot? Explain.
From the scatterplot, draw (if you can), or estimate by eye, an approximation of the regression line. Then, estimate the value of \(b_0\) (the intercept) from the line you drew. What does this mean? Do you think this value is meaningful?
Using the software output, write down the value of \(r\text{.}\) Using this value of \(r\text{,}\) compute the value of \(R^2\text{.}\) What does this mean?
I could have drawn a scatterplot with Price on the vertical axis and Year of manufacture on the horizontal axis (Fig. FigureΒ 33.53, right panel). For this graph:
[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 [370]. Two scatterplots of some relevant data [371] are shown in Fig. FigureΒ 33.55.
[Dataset: Jeans] [297] 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. FigureΒ 33.56).
Figure33.56.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).
[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.
[Dataset: Typing] The Typing dataset contains four variables: typing speed (mTS), typing accuracy (mAcc), age (Age), and sex (Sex) for \(1\,301\) students [69]. Is there evidence of a linear relationship between a personβs mean typing speed and mean accuracy? Explain.