Clastify logo
Clastify logo
Exam prep
Exemplars
Review
HOT

Bivariate Statistics

Master IB Math AI Bivariate Statistics with notes created by examiners and strictly aligned with the syllabus.

IB Syllabus Requirements for Bivariate Statistics

4.4

Linear correlation and regression

4.10

Spearman’s rank correlation coefficient

4.13

Non-linear regression and model evaluation

HL

4.4

LINEAR CORRELATION AND REGRESSION

Bivariate data and scatter diagrams

Bivariate data is a set of paired observations that records two variables for each individual or item. We usually label the explanatory variable xx and the response variable yy. Here, xx is the explanatory-variable value (in units appropriate to the context), while yy is the response-variable value (in units appropriate to the context). Describing a variable as explanatory doesn’t prove that it causes the other variable to change.

A scatter diagram is a coordinate plot in which each paired observation is represented by a point (x,y)(x,y). From the plot, we can judge the direction, strength and form of an association. We can also spot clusters or possible outliers.

  • Positive correlation means that larger values of xx tend to occur with larger values of yy.
  • Negative correlation means that larger values of xx tend to occur with smaller values of yy.
  • Zero correlation means that there is no overall linear tendency.
  • Linear correlation becomes stronger as the points lie closer to a line. A wide cloud suggests weak correlation, while a completely patternless cloud shows no evident correlation.

Zero correlation doesn’t always mean that there is no relationship. A clear curved pattern may have little or no linear correlation. That’s why the graph should be inspected before a numerical coefficient is trusted.

Common scatter-diagram patterns and their correlation.

PatternDirectionLinear strengthScatter shape
Strong positivePositiveStrongPoints close to an upward straight line
Weak positivePositiveWeakUpward trend with a wide scatter
No correlationNo overall linear trendNoneRandom cloud with no clear line
Weak negativeNegativeWeakDownward trend with a wide scatter
Strong negativeNegativeStrongPoints close to a downward straight line
Curved relationNo overall linear trendLittle or noneClear curve with little linear correlation

Pearson’s product-moment correlation coefficient

Pearson’s product-moment correlation coefficient is a dimensionless statistic that measures the direction and strength of a linear relationship between two quantitative variables.

1r1-1 \le r \le 1

The sign of rr shows the direction of the linear association; its magnitude shows the strength:

  • rr close to 11: strong positive linear correlation;
  • rr close to 1-1: strong negative linear correlation;
  • rr close to 00: weak or no linear correlation.

Don’t treat r=0r=0 as proof that the variables are unrelated. Pearson’s coefficient describes linearity, so a strong non-linear relationship may be missed. Outliers can also affect it because the coefficient uses the original numerical values.

Calculate rr using technology. Although a hand calculation can show how standardized deviations combine, you don’t need to derive or prove the coefficient. When a critical value is provided, compare it with the magnitude r|r| to decide whether the evidence for linear correlation meets the stated criterion.

A line of best fit by eye

A line of best fit is a straight line that represents the central linear trend of a scatter diagram. A line drawn by eye should pass through the mean point (xˉ,yˉ)(\bar{x},\bar{y}). In this point, xˉ\bar{x} is the mean of the explanatory-variable values (same unit as xx), and yˉ\bar{y} is the mean of the response-variable values (same unit as yy). Try to balance the spread of points above and below the line instead of joining particular data points.

Image

Regression of yy on xx

A regression line of yy on xx is a least-squares line used to estimate the response variable from a specified value of the explanatory variable. It has equation

y=ax+by=ax+b

For every one-unit increase in xx, the model predicts a change of aa units in yy. If aa is positive, the line increases; if aa is negative, it decreases. The intercept gives the predicted value of yy when x=0x=0. It has useful contextual meaning only when zero is sensible and reasonably close to the observed domain.

Use technology to find the regression equation, and keep enough digits for any later substitution. To make a prediction, substitute the given xx-value, then interpret the resulting yy-value in context.

The order in “yy on xx” is significant. The line minimizes vertical discrepancies and predicts yy from xx. Simply rearranging it to predict xx from a known yy is not generally reliable. A separately calculated regression of xx on yy may be needed instead.

An interpolation is a prediction made within the observed range of the explanatory variable, whereas an extrapolation is a prediction made beyond that range. There is still uncertainty in interpolation. Extrapolation is more dangerous, however, because it assumes that the observed pattern continues. Forecasts in fields such as public health, environmental science or financial modelling rely on that unverified assumption.

Image

Correlation is not causation

Correlation is a statistical association in which two variables tend to vary together. Causation is a relationship in which a change in one factor produces a change in another. Correlation alone cannot establish causation. The association could be caused by a lurking variable, reverse causation, selection bias, coincidence or poor measurement.

For example, a strong association in observational health data may prompt further scientific investigation. Before drawing a causal conclusion, though, we need controlled evidence and a plausible mechanism. This raises an important knowledge question: mathematics can measure an observed pattern with great precision without explaining why that pattern exists.

The reliability and validity of a regression model depend on more than rr. Check how the data were collected and whether the variables were measured consistently. Also consider whether the sample represents the relevant population, whether influential outliers are present, whether a straight line is suitable and whether the prediction remains within the observed domain. Scatter diagrams and curves of best fit occur naturally in experimental science and geographical data analysis, but subject knowledge gives the model its meaning.

4.10

SPEARMAN’S RANK CORRELATION COEFFICIENT

Ranking paired data

Spearman’s rank correlation coefficient is a dimensionless statistic that measures the direction and strength of a monotonic relationship using the ranks of paired observations. The symbol is rsr_s, where rsr_s is Spearman’s rank correlation coefficient (no unit), and

1rs1-1 \le r_s \le 1

A monotonic relationship is an association that moves consistently in one direction, although its rate of change need not be constant. As one variable increases, the other therefore tends always to increase or always to decrease. The pattern can be curved; it doesn’t have to be linear.

Spearman’s coefficient uses ordinal positions instead of the original measurements. Rank both sets of values in the same way—for example, give the smallest value rank 11 in each column—and keep the paired observations together. When two or more values are tied, each receives the average of the ranks they would have occupied. Calculate rsr_s using technology. You don’t need to derive or prove the formula.

Paired data ranked with average ranks for ties

PairxxRank of xxyyRank of yy
A12172
B182.593
C182.551
D244124.5
E305124.5
F366156

Interpret it in much the same way as Pearson’s coefficient. A value near 11 shows a strong increasing monotonic association, while a value near 1-1 shows a strong decreasing monotonic association. A value near 00 suggests little monotonic association.

Choosing between Pearson and Spearman

Choose the coefficient based on the form and quality of the data, not simply on which value looks larger.

FeaturePearson’s rrSpearman’s rsr_s
Data usedOriginal quantitative valuesRanks
Relationship measuredLinearMonotonic, including curved monotonic patterns
Effect of outliersOften strongly affectedUsually less sensitive because only rank positions are used
Suitable for ordinal dataNoYes
Main graphical checkPoints should follow a straight-line patternPoints should show a consistent increasing or decreasing trend

Image

Spearman’s coefficient is less sensitive to outliers, though it isn’t immune to them. An extreme observation may still change rank positions and disrupt the monotonic pattern. Use Pearson’s coefficient when the relationship is genuinely linear and the numerical distances between values matter. Spearman’s is a better choice for ordinal data, a monotonic curve or quantitative data where extreme values would have a disproportionate influence on rr.

Even a large coefficient doesn’t establish causation. Fieldwork in biology, psychology, environmental studies and exercise science often produces observational data where several factors vary together. International databases can help when exploring these associations. Before comparing country ranks, however, check for differences in definitions, collection methods and population structure.

A fitted pattern doesn’t reveal one uniquely “true” equation either. Several curves may describe the same finite dataset adequately. Choosing between them depends on residual behaviour, predictive performance, subject knowledge and plausible mechanisms. Predictions also assume that the observed pattern will persist. Extrapolation is especially vulnerable when social, environmental or economic conditions change.

4.13

NON-LINEAR REGRESSION AND MODEL EVALUATION

HL

Non-linear regression models

A regression curve is a function fitted to bivariate data in order to model the typical value of a response variable for each value of an explanatory variable. If a scatter diagram shows a systematic bend, a non-linear model may fit the data better than a straight line.

You should be able to use technology to fit and assess the following families:

  • linear: y=ax+by=ax+b;
  • quadratic:

y=Ax2+Bx+Cy=Ax^2+Bx+C

  • cubic:

y=Dx3+Ex2+Fx+Gy=Dx^3+Ex^2+Fx+G

  • exponential:

y=Hqxy=Hq^x

  • power:

y=Jxpy=Jx^p

  • sine:

y=Ksin(Lx+M)+Ny=K\sin(Lx+M)+N

These models use different letters to avoid confusing their coefficients with the slope and intercept already used in linear regression. Technology may show different parameter letters, so identify each one from its position in the equation.

An exponential model is closely linked to a geometric sequence: each equal increase in xx multiplies the predicted value by the same factor qq. A quadratic model has one turning point, while a cubic model can change direction twice. Power models often describe scaling. Sine models represent repeated oscillation.

Comparison of the main non-linear regression model families and their typical curve shapes.

ModelGeneral formTypical shapeMain feature
Lineary=ax+by=ax+bStraight lineConstant rate of change
Quadraticy=Ax2+Bx+Cy=Ax^2+Bx+CParabolaOne turning point
Cubicy=Dx3+Ex2+Fx+Gy=Dx^3+Ex^2+Fx+GS-shaped curveCan change direction twice
Exponentialy=Hqxy=Hq^xRapidly bending growth or decay curveEqual steps in xx multiply the output by qq
Powery=Jxpy=Jx^pScaling curveFits relationships of the form output proportional to a power of xx
Siney=Ksin(Lx+M)+Ny=K\sin(Lx+M)+NRepeating waveOscillates with amplitude K\|K\| around the midline y=Ny=N

Start by choosing a plausible model from the scatter diagram and the context. Run the relevant regression, record the equation to suitable precision, then graph it over the data. Don’t assume that a more complicated curve gives a better model. Its extra flexibility may simply chase random variation.

Least squares and residuals

A residual is the signed vertical difference between an observed response and the response predicted by a model. For observation ii,

ei=yiy^ie_i=y_i-\hat{y}_i

A positive residual places the observed point above the curve; a negative residual places it below. Least-squares regression is a fitting method that selects model parameters to minimize the sum of the squared residuals. Squaring stops positive and negative residuals from cancelling. It also gives more weight to large discrepancies.

The sum of square residuals is a non-negative measure of the total squared vertical discrepancy between observations and a fitted model. It is calculated using

SSres=i=1nei2SS_{\mathrm{res}}=\sum_{i=1}^{n} e_i^2

When comparing models for the same response data, a smaller SSresSS_{\mathrm{res}} shows a closer in-sample fit. Don’t use this value alone, though; inspect the residual plots as well. For a suitable model, the residuals should scatter around zero without a systematic curve, trend or changing spread.

Image

The coefficient of determination

The coefficient of determination is a dimensionless statistic giving the proportion of variability in the response variable accounted for by a fitted model. It is written R2R^2, where R2R^2 is the coefficient of determination (no unit), and is evaluated using technology.

For instance, R2=0.82R^2=0.82 says that the model accounts for about 82%82\% of the observed variability in the response variable. It does not say that 82%82\% of the points lie on the curve. Nor does it mean that predictions are 82%82\% accurate or that the explanatory variable causes the response.

The underlying relationship is useful:

R2=1SSresSStotR^2=1-\frac{SS_{\mathrm{res}}}{SS_{\mathrm{tot}}}

For a least-squares linear model with an intercept,

R2=r2R^2=r^2

Squaring removes the sign. As a result, R2R^2 measures explained variation but cannot show whether the linear association is positive or negative. The sign of rr provides that information.

Evaluating validity

A high R2R^2 provides evidence that the model fits the observed responses closely. It does not prove that the model is valid. Before choosing one, ask:

  • Does its shape make sense in the application?
  • Are the residuals patternless and reasonably balanced around zero?
  • Is an outlier distorting the fit?
  • Could a simpler model explain nearly as much?
  • Will the model be used for interpolation or risky extrapolation?
  • Were the data measured reliably and sampled representatively?
  • Do its predictions remain physically or practically possible?

For this reason, graphical analysis in the sciences combines R2R^2 with residuals and subject knowledge. Several models may fit the same dataset well, particularly across a short interval. The most defensible model isn’t necessarily the curve with the largest displayed R2R^2. Choose the one whose assumptions, residual behaviour and contextual interpretation best support its intended use.

Were those notes helpful?

descriptive-statistics Descriptive Statistics