NZ Level 8 (NZC) Level 3 (NCEA) [In development]

Line of best fit - calculating

Lesson

In Does this Fit?, we looked at how to identify a line of best fit. A line of best fit (or "trend" line) is a straight line that best represents the data on a scatter plot. This line may pass through some of the points, none of the points, or all of the points. In this chapter, we are going to look at how to calculate the equation of a given line of best fit.

To calculate the equation of a given line of best fit, we need to be able to calculate:

- gradient: $m=\frac{y_2-y_1}{x_2-x_1}$
`m`=`y`2−`y`1`x`2−`x`1 - y-intercept/ constant term: this is the $b$
`b`term in $y=mx+b$`y`=`m``x`+`b`

Once you can identify these features, you can use them to make conclusions and predictions about the data.

Remember!

There are different ways to calculate the equation of a straight line. These include:

- gradient-intercept form: $y=mx+b$
`y`=`m``x`+`b`, where $m$`m`is the gradient and $b$`b`is the y-intercept - two point form: $\frac{y-y_1}{x-x_1}=\frac{y_2-y_1}{x_2-x_1}$
`y`−`y`1`x`−`x`1=`y`2−`y`1`x`2−`x`1 - point-gradient form: $y-y_1=m\left(x-x_1\right)$
`y`−`y`1=`m`(`x`−`x`1)

Read over Find that Line if you need more info on how to use different formulas.

Since lines of best fit are used in real statistical analyses, graphing them is similar to other linear models that we looked at earlier.

The equation for the line of best fit is given by $P=-4t+116$`P`=−4`t`+116, where $t$`t` is time.

This relationship shows that over time, $P$`P` is:

remaining constant

Adecreasing

Bincreasing

Cremaining constant

Adecreasing

Bincreasing

C

A car company looked at the relationship between how much it had spent on advertising and the amount of sales each month over several months. The data has been plotted on the scatter graph and a line of best fit drawn. Two points on the line are $\left(3200,300\right)$(3200,300) and $\left(5600,450\right)$(5600,450).

Loading Graph...

Using the two given points, what is the gradient of the line of best fit?

The line of best fit can be written in the form $S=\frac{1}{16}A+b$

`S`=116`A`+`b`, where $S$`S`is the value of Sales in thousands of dollars and $A$`A`is advertising expenditure.Determine the value of $b$

`b`, the vertical intercept of the line.Use the line of best fit to estimate the number of sales next month (in dollars) if $\$4800$$4800 is to be spent on advertising.

The table shows the number of people who went to watch a movie $x$`x` weeks after it was released.

Weeks ($x$x) |
$1$1 | $2$2 | $3$3 | $4$4 | $5$5 | $6$6 | $7$7 |

Number of people ($y$y) |
$17$17 | $17$17 | $13$13 | $13$13 | $9$9 | $9$9 | $5$5 |

Plot the points from the table.

Loading Graph...If a line of best fit were drawn to approximate the relationship, which of the following could be its equation?

$y=-2x+20$

`y`=−2`x`+20A$y=2x+20$

`y`=2`x`+20B$y=-2x$

`y`=−2`x`C$y=2x$

`y`=2`x`D$y=-2x+20$

`y`=−2`x`+20A$y=2x+20$

`y`=2`x`+20B$y=-2x$

`y`=−2`x`C$y=2x$

`y`=2`x`DGraph the line of best fit whose equation is given by $y=-2x+20$

`y`=−2`x`+20.Loading Graph...Use the equation of the line of best fit to find the number of people who went to watch the movie $10$10 weeks after it was released.

Carry out investigations of phenomena, using the statistical enquiry cycle: A conducting experiments using experimental design principles, conducting surveys, and using existing data sets B finding, using, and assessing appropriate models (including linear regression for bivariate data and additive models for time-series data), seeking explanations, and making predictions C using informed contextual knowledge, exploratory data analysis, and statistical inference D communicating findings and evaluating all stages of the cycle.

Investigate bivariate measurement data

Use statistical methods to make a formal inference