Scatterplotsskwon.org/ScatterPlot.pdfA strong association between two variables is not enough to...

Post on 17-Mar-2020

0 views 0 download

Transcript of Scatterplotsskwon.org/ScatterPlot.pdfA strong association between two variables is not enough to...

Scatterplots

Example: A study is done to see how the number of beers that a student drinks predicts his/her blood

alcohol content (BAC). Results of 16 students:

How many variables do we have?

Variables and Individuals

• Any characteristics are called variables.

Beers, Blood Alcohol Content. There are two variables.

• Individuals are the objects described by a set of data.

16 individuals

Example: A study is done to see how the number of beers that a student drinks predicts his/her blood

alcohol content (BAC). Results of 16 students:

Are two variables related to each other?

Example: A study is done to see how the number of beers that a student drinks predicts his/her blood

alcohol content (BAC). Results of 16 students:

Are two variables related to each other?

Means

Does the number of consumption of beers

Increase, decrease or doesn’t affect the blood alcohol content?

Example: A study is done to see how the number of beers that a student drinks predicts his/her blood

alcohol content (BAC). Results of 16 students:

Are two variables related to each other?

Yes, although it is not exactly related to each other in a predictable manner, they are related to each other.

Roughly,

Increase of beers

Increase of BAC

Scatterplot, Explanatory Variable, Response Variable

A scatterplot( graph of dots ) is a graph that shows the relationship between two numerical variables, measured on the individuals. Number of dots=

number of individuals.

Scatterplot, Explanatory Variable, Response Variable

• Explanatory variable (x-axis) explains, or causes, the change in another variable.

• Response variable (y-axis) measures the outcome, or response to the change

Learning Objective

Relate the scatterplot graph with a straight line so that we can predict the results which don’t appear as dots in the scatterplot graph.

The straight line will be called a regression line.

About straight line

𝑦 = 𝑎𝑥 + 𝑏

Straight Line 𝒚 = 𝒂𝒙 + 𝒃

𝑎(the number in front of 𝑥) or 𝑏: coefficient

𝑥 ( Unknown number ): variable

𝑏 ( the number which is not associated with 𝑥 ): 𝒚-intercept

Example(Numerical Approach)

(Positive slope)

1. Let 𝑦 = 2𝑥 + 1 and 𝑥 = 0. What is the corresponding 𝑦 − value?

2. Let 𝑦 = 2𝑥 + 1 and 𝑥 = 2. What is the corresponding 𝑦 − value?

3. Plot the graph of the equation.

(Negative slope)

1. Let 𝑦 = −3𝑥 + 5 and 𝑥 = 1. What is the corresponding 𝑦 −value?

2. Let 𝑦 = −3𝑥 + 5 and 𝑥 = 3. What is the corresponding 𝑦 −value?

3. Plot the graph of the equation.

Slope of a Straight Line 𝑦 = 𝒂𝑥 + 𝑏

Positive slope 𝑎 > 0

𝑎 is a positive number.

Rise to the right

Negative slope 𝑎 < 0

𝑎 is a negative number.

Falls to the right

𝒚 −intercept 𝑦 = 𝑎𝑥 + 𝑏

𝑦 = 3𝑥 + 2 𝑦 = −2𝑥 + 1

Going back to Scatterplot…

Terminology (Positive Association≈ positive slope)

Suppose that the given scatterplot looks roughly like a straight line.

Two variables are positively associated if an increase of explanatory variable tends to accompany an increase in the response variable.

Terminology (Negative Association≈ Negative slope )

Suppose that the given scatterplot looks roughly like a straight line.

Two variables are negatively associated if an increase of explanatory variable tends to accompany a decrease in the response variable.

Positive Association Negative Association

Regression Line to predict the value of 𝑦 for a given value of 𝑥

A regression line is a straight line that describes how a response variable 𝑦 changes as an explanatory variable 𝑥 changes.

Regression Line to predict the value of 𝑦 for a given value of 𝑥

A regression line can be written as follows:

𝑥: explanatory variable

𝑦 : response variable

y mx b

Correlation r

Measures the direction and strength of the straight-line relationship between two numerical variables.

Correlation r A correlation r is always a number between −1 and 1.

Correlation r

It has the same sign as the slope of a regression line.

r > 0 for positive association (increase in one variable causes an increase in the other).

Correlation r

It has the same sign as the slope of a regression line.

r < 0 for negative association (increase in one variable causes a decrease in the other)

Correlation r

Perfect correlation r = 1 or r = −1 occurs only when all points lie exactly on a straight line.

Correlation r

Correlation r = 0 indicates no straight-line relationship.

The correlation moves away from 1 or −1 (toward zero)

as the straight-line relationship gets weaker.

Least-Squares Regression Line

A line that makes the sum of the squares of the vertical distances of the data points from the line as small as possible.

Equation of the Least-Squares Regression Line

(Skip at the lecture)

From the data for an explanatory variable x and a response variable y for n individuals, we have calculated the means , , and standard deviations sx , sy , as well as their correlation r.

The least-squares regression line is the line:

Predicted

With slope …

And y-intercept …

y mx b

y

x

sm r

s

b y mx

A Few Cautions When Using Correlation and Regression

Both the correlation r and least-squares regression line can be strongly influenced by a few outlying points.

Always make a scatterplot before doing

any calculations.

Above: Regression line before we remove the outlier on the right top.

Below: Regression line after we remove the outlier which was on the right top.

A Few Cautions When Using Correlation and Regression

Often the relationship between two variables is strongly influenced by other variables.

Before conclusions are drawn based on

correlation and regression, other possible

effects of other variables should be

considered.

A Few Cautions When Using Correlation and Regression

A strong association between two variables is not enough to draw conclusions about cause and effect.

Sometimes an observed association really does reflect cause and effect (such as drinking beer causes increased BAC).

Sometimes a strong association is explained by other variables that influence both x and y.

Remember, association does not imply causation.