Grade by Grade
D. Data · Data, Statistics and Mathematical Modelling

Creating a Mathematical Model from Data

D2.4 D1.3 A1About 75 minutes
Learning goals
  • I can choose a display that suits the nature of my data.
  • I can analyse data and test models to create a mathematical model.
  • I can choose a model by considering the fit, the context and my assumptions.
  • I can use my model to answer the question of interest.

Words to know

nature of the data
Whether data is one-variable or two-variable, numerical or categorical, discrete or continuous, measured over time or for groups.
residual plot
A graph of the residuals against x, used to check whether a model's type is appropriate.
direct variation
A relationship of the form y = kx; its graph is a line through (0, 0).
percentile model
Using a percentile (such as the 90th) from a one-variable distribution to make a decision.
simplest model
When two models fit about equally well, the one with fewer parts that is easier to use and explain.

From data to a model

You have a question of interest, a plan and data. Now comes the heart of modelling: display and analyse the data to create a mathematical model that answers the question.

There is no single right display or model for every situation. The best choice depends on three things the curriculum names: the nature of the data, the context and the assumptions you made.

If your data is...Display it with...A model might be...
One numerical variable (one measurement per person or thing)Histogram, box plot, dot plot, stem-and-leaf plotA summary statistic: mean, median, a percentile, or a range of typical values (Q1 to Q3)
Two numerical variables (pairs)Scatter plotA regression equation: linear, quadratic or exponential
Numerical data for two or more groupsSide-by-side box plotsA comparison of medians and IQRs
Categorical dataBar graph, circle graphPercents or proportions for each category
A variable measured over timeBroken-line graph or scatter plot with time on the x-axisA trend model (often a regression with time as x)
Matching the display and model to the nature of the data.

Steps to create a model

  1. Organize the data (a table, a spreadsheet, a Desmos table).
  2. Display it in a way that suits the data.
  3. Look for a pattern. Is there a trend? Is it linear or curved? Are there outliers?
  4. Test models with technology. Compare R² values, the graphs and the residuals.
  5. Check the context and assumptions. Does the model behave sensibly? For example, should it pass through (0, 0)? Can it ever give a negative value?
  6. Choose a model and use it to answer the question of interest.

When two models fit about equally well, choose the simpler one that makes sense in context.

Drop height (cm)Mean bounce (cm)
5027
7540
10053
12566
15079
17591
200104
Data for Example 1.
Worked example

Example 1: The bounce project, part 3

Use the data from the last lesson to create a model and answer: From what height must the tennis ball be dropped to bounce back up 1 m (100 cm)?

(The data is in the table above.)

  1. Nature of the data: two numerical, continuous variables, so make a scatter plot with drop height on the x-axis.
  2. Pattern: the points rise in an almost perfectly straight line. No outliers.
  3. Test models in Desmos: linear y ≈ 0.513x + 1.61, r² ≈ 0.9999. Quadratic y ≈ −0.000095x² + 0.537x + 0.36, R² ≈ 0.99995. Exponential R² ≈ 0.971.
  4. Choose: linear and quadratic fit almost equally well, but the quadratic's x² coefficient is tiny (−0.000095), so it is basically a line. The linear model is simpler, and it fits the context: a ball bounces back to about the same fraction of its drop height each time (27 ÷ 50 = 0.54 and 104 ÷ 200 = 0.52, both a little over half).
  5. Check the residuals: they are all less than 0.5 cm in size and they go above and below 0 with no strong pattern (any curve is far smaller than the 1 cm precision of the measurements), so a line is appropriate.
  6. Use the model: set y = 100. 100 = 0.513x + 1.61, so 0.513x = 98.39 and x = 98.39 ÷ 0.513 ≈ 191.8 cm.
  7. Check: 191.8 cm is inside the data range (50 to 200 cm), so this is interpolation. Substituting: 0.513(191.8) + 1.61 ≈ 100.0 ✓

Drop the ball from about 192 cm (just under 2 m) to get a 1 m bounce. The model is linear: bounce height ≈ 0.513 × drop height + 1.61.

Tennis ball: drop height vs bounce height04080120160200020406080100120drop height (cm)mean bounce height (cm)bounce of 100 cmat a drop of ≈ 192 cmy = 0.513x + 1.61
The linear model passes almost exactly through the points. The open circle marks where the model gives a 100 cm bounce: a drop of about 192 cm.
Residual plot for the linear model04080120160200-1-0.500.51drop height (cm)residual (cm)
The residuals are small (all within 0.5 cm) and scattered above and below zero with no strong pattern (the slight curve is far smaller than the measurement precision). That is evidence that a linear model is appropriate.

Context check: should it go through (0, 0)?

If you drop a ball from 0 cm, it cannot bounce at all, so a model for the bounce could reasonably pass through (0, 0). Our regression has a y-intercept of 1.61 cm, which is very close to 0 and within measurement error. Another reasonable model is the direct variation y = kx, where k is the mean of the ratios bounce ÷ drop (about 0.528). It gives a drop of 100 ÷ 0.528 ≈ 189 cm. Both models agree: the answer is about 1.9 m.

SkatersLitres
606.5
858
10010.5
12011.5
14014.5
15014
17518
19018.5
21021.5
24023.5
Data for Example 2.
Worked example

Example 2: Hot chocolate at the rink

A community rink recorded the number of skaters and litres of hot chocolate sold at 10 public skates (all on days between −15 °C and −5 °C):

(The data is in the table above.)

Create a model to decide how much to prepare for a skate expected to have 160 skaters.

  1. Two numerical variables: scatter plot with skaters on the x-axis.
  2. Linear regression gives y ≈ 0.098x + 0.21, with r ≈ 0.995 (strong positive).
  3. Meaning of the slope: about 0.098 L (roughly 100 mL) per skater.
  4. For 160 skaters: y ≈ 0.098(160) + 0.21 ≈ 15.9 L.
  5. Assumptions and context: all the data comes from days between −15 °C and −5 °C, so the model assumes similar weather. Running out disappoints customers, while leftovers are wasted, so the rink might add a small buffer.

Prepare about 16 L (perhaps 17 to 18 L to be safe) on a day between −15 °C and −5 °C. On a much warmer or colder day, the model may not apply.

Public skates: skaters and hot chocolate0408012016020024004812162024number of skatershot chocolate sold (L)y = 0.098x + 0.21
A strong positive linear relationship: each extra skater adds about 0.1 L of hot chocolate sales.
Worked example

Example 3: A one-variable model

A school wants to choose how many minutes to allow between the bus arriving and the first bell so that at least 90% of students reach class in time. Fifty students timed their walk from the bus to class. The five-number summary is 2, 4, 5.5, 7, 12 minutes, and the 90th percentile is 9 minutes. What model should the school use?

  1. Nature of the data: one numerical variable (walking time), so a box plot or histogram, and a percentile model.
  2. The question asks for a time that works for at least 90% of students: that is the 90th percentile, 9 minutes.
  3. The median (5.5 min) would only cover about half of the students; Q3 (7 min) about 75%.
  4. Assumption: this sample of 50 represents all bus students, and conditions are similar (in deep snow, walking may take longer).

Allow at least 9 minutes, and consider adding time on snowy days. Here the "model" is a percentile from a one-variable distribution.

Just for fun

Riddle: I am a line that never gets lost, because I always follow the trend. What am I?

A line of best fit!

Hands-on activity

Build your model

You need: the data you collected in the last lesson (or the bounce data in this lesson), and Desmos or a spreadsheet.

  1. Decide the nature of your data (one variable, two variables, groups, categories, over time). Choose and make an appropriate display.
  2. Describe the pattern in one or two sentences.
  3. If you have two numerical variables, test at least two regression models and record R² for each. If you have one variable, find the five-number summary, mean and any useful percentile.
  4. Choose a model. Write two reasons for your choice: one about the fit (R², residuals) and one about the context.
  5. Use your model to answer your question of interest. Show the calculation.

What to look for: a display that suits the data, at least two models compared (for two-variable data), a choice justified with fit and context, and an answer to the original question.

Your turn

1

What display would you use for: the heights of 200 maple seedlings after one year?

2

What display would you use for: the number of hours of daylight and the date, for each day of a year?

3

Two models for the same data have R² = 0.962 (linear) and R² = 0.965 (quadratic). Which would you choose if both make sense in context? Why?

4

Using the bounce model y = 0.513x + 1.61, predict the bounce for a drop of 120 cm.

5

Using the bounce model, what drop height gives a 50 cm bounce?

6

Using the hot-chocolate model y = 0.098x + 0.21, how much should be prepared for 220 skaters?

7

Why does it matter that the hot-chocolate data was collected only on days between −15 °C and −5 °C?

More practice: warm-up

1

Which display suits two numerical variables?

2

Which display suits comparing test marks of three classes?

3

What should residuals look like if a model is appropriate?

4

Should a model of bounce height pass close to (0, 0)? Why?

5

Name two things to check before choosing a model.

More practice: on your own

1

The residuals for a linear model are positive at both ends and negative in the middle. What does this suggest?

2

Using the direct variation y = 0.528x, predict the bounce for a 150 cm drop and compare with the data.

3

For the walking-time data (summary 2, 4, 5.5, 7, 12 min), what time would cover about 75% of students? Explain.

4

A student's model for the price of a used phone (y, $) by age (x, years) is y = −120x + 600. What does the model predict for a 6-year-old phone? What does this tell you about the model?

5

Explain why a model for snow-shovelling time might use two independent variables.

Challenge

1

In the bounce project, how much higher must the ball be dropped for each extra 10 cm of bounce? Use the slope.

2

A ball keeps bouncing, and each bounce reaches 0.53 of the previous height. Starting from a 200 cm drop, write a model for the height of the nth bounce and find the height of the 4th bounce.

3

The rink wants a model that also uses temperature. Describe what extra data it would need and how the model might change.

Check your understanding

Quiz

1.

Which display best suits data on the arm span and height of 30 students?

2.

Two models fit with R² = 0.991 (linear) and 0.993 (quadratic), and both make sense. Which is a reasonable choice?

3.

A linear model gives y = 0.5x + 2. What x gives y = 42?

4.

What do randomly scattered, small residuals tell you?

5.

A one-variable data set of delivery times is used to choose a time that 95% of deliveries meet. Which statistic should be used?

6.

A model of a car's value predicts a negative value after 10 years. What is the best response?

For parents and teachers

Big idea: D2.4 asks students to determine ways to display and analyse data to create a mathematical model, taking into account the nature of the data, the context and the assumptions made. Students will use D1 skills (box plots, scatter plots, regression) here as tools.

How to help: Ask your teen to defend their model choice with two reasons: one about fit (R², residuals) and one about the real situation. If they cannot explain why the model makes sense, it may be the wrong one.

Common difficulties:

  • Choosing the model with the highest R² without thinking about context.
  • Forgetting to actually answer the original question.
  • Solving for x incorrectly when the question gives y (for example, the bounce height). Practise rearranging y = mx + b.