Linear Modelling Notes

Linear Modelling

Syllabus Reference

  • 5.4

Chapter Contents

  • Correlation

  • Pearson's correlation coefficient

  • Line of best fit

  • The least squares regression line

  • Interpolation and extrapolation

Opening Problem: Discus Throw

  • A group of young athletes throw a discus, and their age and distance thrown are recorded.

  • The data includes the athlete's age in years and the distance thrown in meters.

Things to Think About
  • Is there a relationship between age and distance thrown?

  • How can the data be graphed to visualize this relationship?

  • How can the relationship be measured?

  • How can this data predict the distance a 14-year-old athlete can throw?

Introduction to Linear Modelling
  • Statisticians are interested in how variables are related.

  • In the opening problem, the goal is to understand how a change in age affects the distance thrown.

  • The relationship between variables can be observed by plotting data on a scatter diagram.

  • The independent variable (age) is placed on the horizontal axis, and the dependent variable (distance) on the vertical axis.

  • Each data value is plotted as a point on the diagram.

  • The general shape of the points indicates how age and distance are related.

Example
  • Athlete H is 10 years old and threw the discus 15 meters, represented by a point on the scatter diagram.

  • The scatter diagram shows that as age increases, so does the distance thrown.

Correlation

  • Correlation refers to the relationship or association between two variables.

  • Characteristics to consider when describing correlation:

    • Direction

    • Linearity

    • Strength

    • Outliers

    • Causation

Direction
  • Positive Correlation: Generally upward trend. An increase in the independent variable results in an increase in the dependent variable.

  • Negative Correlation: Generally downward trend. An increase in the independent variable results in a decrease in the dependent variable.

  • No Correlation: Randomly scattered points with no upward or downward trend.

Linearity
  • Linearity determines whether the points follow a linear trend, approximately forming a straight line.

  • Example of Roughly Linear points:

    • Points are scattered closely around an imaginary straight line.

  • Example of Non-Linear points:

    • Points do not follow a straight line.

Strength
  • Strength indicates how closely the data follows a pattern or trend.

  • Described as strong, moderate, or weak.

    • Strong: Data points are very close to forming a line.

    • Moderate: Data points show a clear trend but with more scatter.

    • Weak: Data points show a vague trend with significant scatter.

  • Examples:

    • strong positive correlation

    • moderate positive correlation

    • weak positive correlation

    • strong negative correlation

    • moderate negative correlation

    • weak negative correlation

Outliers
  • Outliers are isolated points that do not follow the trend formed by the main body of data.

  • Investigate outliers to determine if they are due to recording errors or genuine data.

  • Discard outliers resulting from recording or graphing errors.

  • Keep genuine outliers.

  • In the discus throwing data, there is a strong positive correlation between age and distance thrown, the relationship appears to be linear, with no outliers.

Causation
  • Correlation does not necessarily imply causation.

    • A strong positive correlation between arm length and running speed in young children doesn't mean short arms cause a reduction in running speed, or high running speed causes arms to grow long.

    • A third variable, age, is closely related to both arm length and running speed.

  • A strong positive correlation between the number of television sets sold in Ballarat and the number of stray dogs collected in Bendigo doesn't mean one influences the other.

    • Both variables have simply been increasing over time.

  • Causal relationship exists when a change in one variable causes a change in the other variable.

    • For example, in the Opening Problem, increasing the age of an athlete increases the distance thrown.

Case Study: Mass on a Spring

  • Examines the relationship between the length of a helical spring and the mass hung from it.

  • The force of gravity on the mass causes the spring to stretch.

  • The length of the spring depends on the force applied, so the dependent variable is the length.

  • Experimental results are obtained by hanging objects of varying mass from the spring.

Experimental Results
  • Mass ww (grams): 0, 50, 100, 150, 200, 250

  • Length LL (cm): 17.7, 20.4, 22.0, 25.0, 26.0, 27.8

  • For each addition of 50 grams in mass, the consecutive increases in length are roughly constant.

  • The relationship appears to be linear, with no obvious outliers.

Analysis
  • There is a strong positive correlation between the mass of the object and the length of the spring.

Exercise 21A

  1. Definitions:

    • (a) Scatter Diagram: A visual representation of the relationship between two variables, where each point represents a pair of values.

    • (b) Correlation: The relationship or association between two variables.

    • (c) Positive Correlation: A relationship where an increase in one variable is associated with an increase in the other.

    • (d) Negative Correlation: A relationship where an increase in one variable is associated with a decrease in the other.

    • (e) Outlier: An isolated point that does not follow the trend formed by the main body of data.

  2. Commenting on Scatter Diagrams:

    • (i) Pattern: Determine if there is a positive, negative, or no correlation.

    • (ii) Relationship Strength: Assess the strength (zero, weak, moderate, or strong) of the correlation.

    • (iii) Linearity: Determine whether the relationship is linear.

    • (iv) Outliers: Identify any outliers.

Question 3: Typing Contest
  • Data table shows number of words typed (x) and number of errors (y) for ten students.

    Student

    A

    B

    C

    D

    E

    F

    G

    H

    I

    J

    Number of words typed (x)

    40

    53

    20

    65

    35

    60

    85

    49

    35

    76

    Number of errors (y)

    11

    15

    1

    4

    2

    2

    30

    16

    2

    25

  • a Draw a scatter diagram for this data.

  • b Name the student who is best described as:

    • i slow but accurate (Student C has the lowest error and the lowest words typed)

    • ii fast but inaccurate (Student G has the highest words typed but also the highest error)

    • iii an outlier (Student G)

  • c Describe the direction and strength of correlation between these variables.

    • Correlation: Negative because, as the number of words increases, the number of errors tends to decrease. Strength: Weak to moderate.

  • d Is the data linear?

    • Linearity: The data seems non-linear.

Question 4: Ice Skating Competition
  • Scores awarded by two judges (A and B) are provided for ten competitors.

    Competitor

    P

    Q

    R

    S

    T

    U

    V

    W

    X

    Y

    Judge A

    5

    6.5

    8

    9

    4

    2

    5

    7

    5

    6

    Judge B

    6

    7

    8.5

    9

    5

    4

    7.5

    5

    6

    3

  • a Construct a scatter diagram for this data with Judge A's scores on the horizontal axis and Judge B's scores on the vertical axis.

  • b Copy and complete comments about the scatter diagram:

    • There appears to be a positive correlation between Judge A's scores and Judge B's scores. This means that as Judge A's scores increase, Judge B's scores increase.

  • c Would it be reasonable to conclude that an increase in Judge A's scores causes an increase in Judge B's scores?

    • No, it would not be reasonable to suggest that one causes the other because both are evaluating the same performance, and so the scores should be correlated.

Pearson's Correlation Coefficient

  • Classifies the strength of correlation as Strong, Moderate, or Weak.

  • Provides a more precise measure of the strength of linear correlation using Pearson's product-moment correlation coefficient rr.

  • Formula: r=sum of (x-xi)(y-yi)/radical|sum of (x-xi)² sum of (y-yi)²

  • Not required to memorize the formula; technology is used to find the value of rr.

Properties of rr
  • Values range from -1 to +1.

  • Sign indicates the direction of the correlation.

    • Positive value: positively correlated.

    • Negative value: negatively correlated.

  • Size indicates the strength of the correlation.

    • Close to +1 or -1: strong correlation.

    • Close to zero: weak correlation.

Guide for Describing Correlation

Correlation

Positive Correlation

Negative Correlation

Perfect

r=1r = 1

r=−1r = -1

Very Strong

0.95<r<10.95 < r < 1

−1<r<−0.95-1 < r < -0.95

Strong

0.87<r<0.950.87 < r < 0.95

−0.95<r<−0.87-0.95 < r < -0.87

Moderate

0.5<r<0.870.5 < r < 0.87

−0.87<r<−0.5-0.87 < r < -0.5

Weak

0.1<r<0.50.1 < r < 0.5

−0.5<r<−0.1-0.5 < r < -0.1

No Correlation

0<r<0.10 < r < 0.1

−0.1<r<0-0.1 < r < 0

Example 1: Chemical Fertilizer

  • A chemical fertilizer company wants to determine the correlation between the quantity of compound X used and lawn growth per day.

  • Data:

    • Compound X (g): 1, 2, 3, 4

    • Lawn growth (mm): 3, 4, 6, 7

Steps:
  1. Calculate the means: xˉ=3,yˉ=5\bar{x} = 3, \bar{y} = 5

  2. Calculate correlation coefficient rr

    • r=∑(x<em>i−xˉ)(y</em>i−yˉ)∑(x<em>i−xˉ)2∑(y</em>i−yˉ)2=1310×18≈0.969r = {\sum(x<em>i - \bar{x})(y</em>i - \bar{y}) \over \sqrt{\sum(x<em>i - \bar{x})^2 \sum(y</em>i - \bar{y})^2}} = {13 \over \sqrt{10 \times 18}} \approx 0.969

  3. Interpret the correlation coefficient:

    • There is a very strong positive correlation between the quantity of compound X used and lawn growth.

    • Suggests that the more of compound X used, the greater the lawn growth per day.

    • Caveat: Small amount of data may provide a misleading result.

Example 2: Weight and Sprint Speed

  • Measure the weight and maximum sprint speed of a group of adults.

  • Data:

    • Weight xx (kg): 85, 60, 78, 100, 83, 67, 79, 62, 88, 68

    • Maximum speed yy (km/h): 26, 29, 24, 17, 22, 30, 25, 24, 19, 27

Objective:
  1. Use technology to find rr for the data.

  2. Describe the correlation between weight and maximum speed.

Solution:
  • a) Using technology, r≈−0.813r \approx -0.813.

  • b) Since −0.87<r<−0.5-0.87 < r < -0.5, there is a moderate negative correlation between weight and maximum speed.

Exercise 21B

  1. Matching scatter diagrams with correlation coefficient r values

    • Correlation Coefficient Values (r): 1, 0.6, 0, -0.7, -1

    • Matching scatter diagrams to r values involves visually assessing the direction and strength of the linear relationship.

  2. Calculate the correlation coefficient r using the formula

    • r=∑(x<em>i−xˉ)(y</em>i−yˉ)∑(x<em>i−xˉ)2∑(y</em>i−yˉ)2r = {\sum(x<em>i - \bar{x})(y</em>i - \bar{y}) \over \sqrt{\sum(x<em>i - \bar{x})^2 \sum(y</em>i - \bar{y})^2}}

  3. Correlation Between Age and Number of Doctor Visits

    • Describe the correlation between age and number of doctor visits

  4. Correlation Between Temperature and Drying Time

    • Describe the correlation between temperature and drying time.

Ticket and Beverage Sales
  • Data: Ticket sales and beverage sales for each day of a music festival.

  • Objective: Calculate and describe the correlation between ticket sales and beverage sales.
    Sales Description

  1. Ticket sales

Park Size and Number of Trees
  • Data: Size in hectares and number of trees in various parks.

  • Examine whether there are outliers

  • Objective: Calculate r, analyze outliers, and describe the correlation.

Line of Best Fit

  • A line that models the data, shown when there is a correlation between variables.

Method for Drawing a Line of Best Fit

Steps:
Calculate the mean of the XX values, xˉ\bar{x}, and the mean of the YY values, yˉ\bar{y}.
Mark the mean point (xˉ,yˉ)(\bar{x}, \bar{y}) on the scatter diagram.
Draw a line through the mean point that fits the trend of the data, with about the same number of data points above and below the line.
The line formed is called a line of best fit by eye and will vary from person to person.

A line of best fit is used to estimate the value of yy for any given value of xx, and vice versa.

Example 3: Mass on a Spring

Given Data:

Mass (w grams)

0

50

100

150

200

250

Length (L cm)

17.7

20.4

22.0

25.0

26.0

27.8

A. Draw a Scatter Diagram and Line of Best Fit:

Plot the data points on a scatter diagram and draw a line of best fit incorporating the mean point.

Solution:
  • Mass Mean: wˉ=125\bar{w} = 125 grams.

  • Length Mean: Lˉ=23.15\bar{L} = 23.15 cm.

  • .. Mean point is (125, 23.15)

  • Mass is on the x-axis and length is on the y-axis

B. Find the Equation of the Line:
Solution:
  • Line passes through (125, 23.15) and (200, 26).

  • Gradient mm is about 0.040.04.

  • Equation of the line is y=0.04x+18y = 0.04x + 18, or in this case, L≈0.04w+18L \approx 0.04w + 18

Exercise 21C

For each of the following data sets:

Draw a scatter diagram and draw a line of best fit incorporating the mean point
Find the equation of the line you have drawn
Data Sets
  • x 1|3|4|5|6|8
    y 2|3|3|4|5|7

  • x 13|18|7|11|12|6|15|4|17|3
    y 10|6|17|18|13|14|6|6|15|5|14

  • x 11|7|16|4|8|10|17|5|12|2|8|13|9|18|5|12
    y 16|12|32|5|7|19|30|14|19|6|17|24|15|34|6|26

  • Draw a line of best fit through the data.

  • Find the equation of the line of best fit.

  • Investigate Speed Cameras

  • Does your line cut the y-axis?, what does this mean?

Least Squares Regression Line

  • Linear Regression is a better method of using the line of best fit as it does not vary from one person to another.

  • Method of "least squares".

  • For any line drawn to model the linear relationship between the points, we can find the vertical distances d1d1, d2d2, d3d3… . between each point and the line. Also known as residuals.

  • Then square each of these distances, and find their sum d<em>12+d</em>22+d32+….d<em>1^2 + d</em>2^2 + d_3^2 + ….

  • If the line is a good fit for the data, most of the distances will be small, and so will the sum of their squares.

  • The least squares regression line is the line which makes this sum as small as possible.

  • In practice, rather than finding the regression line by experimentation, we use a calculator or statistics package.

Example 4: Least Squares Regression Line

Objective

Use technology to find the least squares regression line for the mass on a spring data:

Given data:

Mass (w grams): 0, 50, 100, 150, 200, 250

Length (L cm): 17.7, 20.4, 22.0, 25.0, 26.0, 27.8

Solution

The least squares regression line is approximately y≈0.0402x+18.1y \approx 0.0402x + 18.1, or L≈0.0402w+18.1L \approx 0.0402w + 18.1

Exercise 21D

Find the least squares regression line for each data set:

Find the least squares regression line

Steve wanted to see whether there was any relationship:

Collect Data, Draw a scatter diagram, calculate r, is there a line of best fit that can be used, explain the answer

Calculating R for the data:

Examine the petrol prices, number of customers, describe the questions.

Interpolation and Extrapolation

Definition

Suppose we have gathered data to investigate the association between two variables. We obtain the scatter diagram shown below. The data with the lowest and highest values of x are called the poles.

  • We use the least-squares regression line to estimate values of one variable given a value for the other.

  • If we use values of x in between the poles, we say we are interpolating between the poles.

  • If we use values of x outside the poles, we say we are extrapolating outside the poles.

Accuracy of Interpolation
  • Depends on how linear the original data was.

  • This can be gauged by determining the correlation coefficient and ensuring that the data is randomly scattered around the linear regression line.

Accuracy of Extrapolation
  • Depends not only on how linear the original data was but also on the assumption that the linear trend will continue past the poles.

  • The validity of this assumption depends greatly on the situation we are looking at.

General Rule

As a general rule, it is reasonable to interpolate between the poles, but unreliable to extrapolate outside the poles.

Example 5: Distance And Travel

The table below shows how far a group of students live from school and how long it takes them to travel there each day.

  • Distance from school x (km)

  • Time to travel to school y (min)

Steps Include
  • Draw a scatter diagram of the data.

  • Use technology to find the equation

  • Given the linear equation, evaluate how long a student in similar situation would take to travel to that distance.

  • reliability

Exercises

A series of problems used to evaluate understanding skills and test the knowledge.

Probability

In the field of probability theory we use mathematics to describe the chance or likelihood of an event happening
Number line indicating probability of happening impossible to certain.

Experimental Probability

Investigating Tossing Drawing Pins

The different situations of doing experimental work to test theories, tossing experiments, coin and dice rolling simulations.
Representing a sample space with: Lists, Two-dimensional grids, tree diagrams and Venn diagrams.

Listing Outcomes Methods for calculating probabilities

The number of members of the event
The total number of possible events

Complementary Events

P(A) + P(A') = 1