18
Chapter 12 Chapter 12 Inference for Linear Inference for Linear Regression Regression

Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

Embed Size (px)

Citation preview

Page 1: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

Chapter 12Chapter 12

Inference for Linear RegressionInference for Linear Regression

Page 2: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

Reminder of Linear Reminder of Linear RegressionRegression First thing you should do is First thing you should do is

examine your data…examine your data… Look at your scatterplot. Does it Look at your scatterplot. Does it

appear linear? Are there outliers? appear linear? Are there outliers? What direction is it going in? Is What direction is it going in? Is there a strong relationship?there a strong relationship?

LSR: y-hat = a + bxLSR: y-hat = a + bx a = y-intercept; b= slopea = y-intercept; b= slope Slope is the rate of change in y for Slope is the rate of change in y for

every one x.every one x.

Page 3: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

Statistics versus parametersStatistics versus parameters

a and b are statistics (estimates a and b are statistics (estimates of y-intercept and slope).of y-intercept and slope).

αα and and ββ are unknown are unknown parametersparameters

a is an unbiased estimator of a is an unbiased estimator of αα and b is an unbiased estimator and b is an unbiased estimator of of ββ

Page 4: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

We are interested in We are interested in ββ

We are going to look at We are going to look at inference for inference for ββ (slope). (slope). Confidence Intervals and Confidence Intervals and

Hypothesis tests. Hypothesis tests.

Page 5: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

Confidence IntervalsConfidence Intervals

These will be t-testsThese will be t-tests What is the basic formula for What is the basic formula for

confidence intervals?confidence intervals? Estimate +/- margin of errorEstimate +/- margin of error Estimate +/- t-statistic*Standard Estimate +/- t-statistic*Standard

ErrorError For inference for the true mean For inference for the true mean

slope (slope (ββ)) b +/- t*(SE) b +/- t*(SE)

Page 6: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

Standard Error and DFStandard Error and DF

You will either be given this You will either be given this information or you can get your information or you can get your calculator to give it to you!calculator to give it to you!

Degrees of freedom = n – 2Degrees of freedom = n – 2 Why?Why?

Page 7: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

Computer OutputComputer Output

Look with me pg 770Look with me pg 770 Remember, under coefficient…Remember, under coefficient…

Constant = y-interceptConstant = y-intercept Variable definition = slopeVariable definition = slope

Standard error is the second Standard error is the second row under STDevrow under STDev

Page 8: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

Hypothesis TestsHypothesis Tests

Generally, Generally, HH00 = 0 = 0

This says that the true slope is zero, This says that the true slope is zero, which means there is no change in y. which means there is no change in y. This can be different if the context of This can be different if the context of the problem would mean that no the problem would mean that no change is not zero…change is not zero…

Page 9: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

Calculator!Calculator!

Put your data in List 1 and List 2Put your data in List 1 and List 2 In your calculator, you go to In your calculator, you go to

LinRegTTest under Stat, TestLinRegTTest under Stat, Test

Page 10: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

Example Example

How well does the number of How well does the number of beers a student drinks predict beers a student drinks predict his or her blood alcohol level? his or her blood alcohol level? Sixteen student volunteers at Sixteen student volunteers at Ohio State University drank a Ohio State University drank a randomly assigned number of randomly assigned number of cans of beer. Thirty minutes cans of beer. Thirty minutes later, a police officer measured later, a police officer measured their blood alcohol content their blood alcohol content (BAC).(BAC).

Page 11: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

The DataThe Data

StudentStudent 11 22 33 44 55 66 77 88

BeersBeers 55 22 99 88 33 77 33 55

BACBAC 0.100.10 0.030.03 0.190.19 0.120.12 0.040.04 0.090.0955

0.070.07 0.060.06

StudentStudent 99 1010 1111 1212 1313 1414 1515 1616

BeersBeers 33 55 44 66 55 77 11 44

BACBAC 0.020.02 0.050.05 0.070.07 0.100.10 0.080.0855

0.090.09 0.010.01 0.050.05

Page 12: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

ConditionsConditions

Observations are independentObservations are independent You don’t observe the same You don’t observe the same

person multiple timesperson multiple times The true relationship is linearThe true relationship is linear

Check residual plot for scatter. Check residual plot for scatter. Look at scatter plot.Look at scatter plot.

Page 13: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

Conditions ContinuedConditions Continued

The spread is uniformThe spread is uniform The residual plot does not have a The residual plot does not have a

cone like appearance.cone like appearance. The residuals have a normal The residuals have a normal

distribution.distribution. Graph residualsGraph residuals

Page 14: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

ResidualsResiduals

Since almost all the conditions deal Since almost all the conditions deal with residuals, we should probably with residuals, we should probably reviewreview

Residual = observed – predictedResidual = observed – predicted y – (y-hat)y – (y-hat)

In you calculator: Define L3 as L2 – In you calculator: Define L3 as L2 – Y1(L1)Y1(L1)

You can look at a scatter plot of L1 You can look at a scatter plot of L1 vs. L3 to see residual plot.vs. L3 to see residual plot.

To determine normality, look at a To determine normality, look at a histogram of L3histogram of L3

Page 15: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

Example of Ohio State Example of Ohio State UniversityUniversity

Check your conditions for the Check your conditions for the previous problem.previous problem.

Let’s finish the problem now.Let’s finish the problem now.

Page 16: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

Example of when HExample of when H00 is not is not ββ = 0 = 0

Page 17: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

Homework:Homework: Read Chapter 12. Do questions Read Chapter 12. Do questions

#9, 10, 14, 18, MC 21-#9, 10, 14, 18, MC 21-26(explain)26(explain)

Page 18: Chapter 12 Inference for Linear Regression. Reminder of Linear Regression First thing you should do is examine your data… First thing you should do is

You have now You have now finished all of your finished all of your

AP Statistics AP Statistics Course work!!!!!!!Course work!!!!!!!