









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Learning goals for this chapter:
Describe the form, direction, and strength of a scatterplot. Use SPSS output to find the following: least-squares regression line, correlation, r^2 , and estimate for σ. Interpret a scatterplot, residual plot, and Normal probability plot. Calculate the predicted response and residual for a particular x-value. Understand that least-squares regression is only appropriate if there is a linear relationship between x and y. Determine explanatory and response variables from a story. Use SPSS and the t table to find the confidence interval for the regression slope and intercept. Perform a hypothesis test for the regression slope and for zero population correlation/independence, including: stating the null and alternative hypotheses, obtaining the test statistic and P-value from SPSS, and stating the conclusions in terms of the story. Understand that correlation and causation are not the same thing. Estimate correlation for a scatterplot display of data. Distinguish between prediction and extrapolation. Check for differences between outliers and influential outliers by rerunning the regression. Know that scatterplots and regression lines are based on sample data, but hypothesis tests and confidence intervals give you information about the population parameter.
When you have 2 quantitative variables and you want to look at the relationship between them, use a scatterplot. If the scatter plot looks linear, then you can do least squares regression to get an equation of a line that uses x to explain what happens with y.
The general procedure:
Association
Positive, negative, or no association Remember: ASSOCIATON or CORRELATION is NOT the same thing as CAUSATION. (See chapter 3/2.5 notes.)
Response variable : Y Dependent variable measures an outcome of a study
Explanatory variable : X Independent variable explains or is related to changes in the response variables (p. 105)
Scatterplots : Show the relationship between 2 quantitative variables measured on the same individuals
Dots only—don’t connect them with a line or a curve
Form: Linear? Non-linear? No obvious pattern?
Direction: Positive or negative association? No association?
Strength: how closely do the points follow a clear form? Strong or weak or moderate?
Look for OUTLIERS!
Correlation : measures the direction and strength of the linear relationship between 2 quantitative variables, r. It is the standardized value for each observation with respect to the mean and standard deviation.
Example : We want to examine whether the amount of rainfall per year increases or decreases corn bushel output. A sample of 10 observations was taken, and the amount of rainfall (in inches) was measured, as was the subsequent growth of corn.
Amount of Rain Bushels of Corn 3.03 80 3.47 84 4.21 90 4.44 95 4.95 97 5.11 102 5.63 105 6.34 112 6.56 115 6.82 115
The scatterplot:
a) What does the scatterplot tell us? What is the form? Direction? Strength? What do we expect the correlation to be?
amount of rain (in)
2 3 4 5 6 7
corn y e d (bushe s)
120
110
100
90
80
70
Correlations
amount of rain (in)
corn yield (bushels) amount of rain (in) Pearson Correlation (^1) .995() Sig. (2-tailed) (^).. N (^10 ) corn yield (bushels) Pearson Correlation (^) .995() 1 Sig. (2-tailed) (^).. N (^10 ) ** Correlation is significant at the 0.01 level (2-tailed).
Inference for Correlation:
R = correlation
R^2 = % of variation in Y explained by the regression line (the closer to 100%, the better)
ρ (Greek letter rho) = correlation for the population
When ρ = 0, there is no linear association in the population, so X and Y are independent (if X and Y are both normally distributed).
Hypothesis test for correlation:
To test the null hypothesis H 0 : ρ = 0, SPSS will compute the t statistic: 2
r n t r
degrees of freedom = n – 2 for simple linear regression.
b) Are corn yield and rain independent in the population? Perform a test of significance to determine this.
c) Do corn yield and rain have a positive correlation in the population? Perform a test of significance to determine this.
This test statistic for the correlation is numerically identical to the t statistic used to test H 0 : (^) 1 = 0.
Can we do better than just a scatter plot and the correlation in describing how x and y are related? What if we want to predict y for other values of x?
d) What is the least-squares regression line equation?
The scatterplot with the least squares regression line looks like:
Confidence Intervals and Significance Tests for Regression Slope and Intercept
Level C confidence interval for the intercept (^) 0 is
0
b 0 (^) t SEb
Level C confidence interval for the slope (^) 1 is
1
b 1 (^) t SEb
SPSS will also give you these confidence intervals for 95%, but you may have to use the estimates for the coefficients and their standard errors to find other confidence intervals (use t table and n - 2 degrees of freedom to get t* ).
Hypothesis testing for H 0 : (^) 1 = 0
Test statistic :^1 b 1
b t SE
with df = n - 2
SPSS will give you the test statistic (under t), and the 2-sided P -value (under Sig.).
e) Give a 95% confidence interval for the slope.
amount of rain (in)
2 3 4 5 6 7
120
110
100
90
80
70 Rsq = 0.
R^2 is the percent of variation in corn yield explained by the regression line with rain= 99.06%
f) Give a 90% confidence interval for the slope.
g) Is the slope positive? Perform a test of significance.
h) What % of the variability in corn yield is explained by the least squares regression line?
i) What is the estimate of the standard error of the model?
What do we mean by prediction or extrapolation? Use your least-squares regression line to find y for other x- values. Prediction : using the line to find y-values corresponding to x -values that are within the range of your data x -values. Extrapolation : using the line to find y -values corresponding to x -values that are outside the range of your data x -values. Be careful about extrapolating y -values for x -values that are far away from the x data you currently have. The line may not be valid for wide ranges of x!
Example : On the rain/corn data above, predict the corn yield for
a) 5 inches of rain
b) 7.2 inches of rain
c) 0 inches of rain
d) 100 inches of rain
e) For which amounts of rainfall above do you think the line does a good job of predicting actual corn yield? Why?
Residual is the vertical difference between the observed y-value and the regression line y -value: residual ei yi y ˆ i yi a bxi ydata yline
Residual plot : scatterplot of the regression residuals against the explanatory variable ( e vs. x ) e -axis has both negative and positive values but centered about e = 0. the mean of the least-squares residuals is always zero. e 0 Good: total randomness, no pattern, approximately the same number of points above and below the e = 0 line Bad: obvious pattern, funnel shape, parabola, more points above 0 than below (or vice versa) if you have a pattern, your data does not necessarily fit the model (line) well
Example: Show a residual plot for the corn/rain data using SPSS.
amount of rain (in)
Unstandardized Residual 2 3 4 5 6 7
.
-. -1. -1. -2.
Outliers : Outliers are observations that lie outside the overall pattern of the other observations. Outliers in the y direction of a scatterplot have large regression residuals ( ei ) Outliers in the x direction of a scatterplot are often influential for the regression line An observation is influential if removing it would markedly change the result of the calculation Outliers can drastically affect regression line, correlation, means, and standard deviations. You can draw a second regression line that doesn’t include the outliers—if the second line moves more than a small amount when the point is deleted or if R^2 changes much, the point is influential
Which hypothesis test do you use when? If you’re not sure whether to use β 1 or ρ, here are some guidelines. The test statistics and P-values are identical for either symbol.
Use If the words are: β 1 Slope, regression coefficient ρ Correlation, independence Either β 1 or ρ linear relationship
Review of SPSS instructions for Regression: When you set up your regression, you click on:
Analyze-->Regression-->Linear. Put in your y variable for "dependent" and your x variable for "independent" on the gray screen. Don't hit "ok" yet though.
At the bottom of that gray screen, click on "Statistics" and then click on "confidence intervals" if you will want the confidence intervals for any part of the problem. You can also click on "descriptives" if you want information like the mean and standard deviation for each variable. Click "continue" to the Statistics gray screen.
Back on the regression gray screen, click on "Plots", and then click on "normal probability plot." Click "continue" on the Plots gray screen.
Back on the regression gray screen, click on "Save", and then click on "unstandardized residuals." Click "continue" on the Save gray screen and then "ok" to the big Regression gray screen.
You still won't have a residual plot yet. If you click back to your data input screen, you now have a new column called "Res_1". To make the residual plot, you follow the same steps for making a scatterplot: go to graphs-->scatter-->simple, then put "res_1" in for y and your x
How will I ever use this stuff again in my future career?
Testimonial from a Former Student (E-mails received June 9, 2005)
Ellen,
I hope that all is well. It is your favorite student here, Eric from your Fall 04 stat 301 class. I need some help. Believe it or not, you were right and I am using stat everyday all day long , but I am drawing a blank. I am trying to determine a linear regression line and I can't remember the equation. Y=mx+b or course but on the regression analysis output what do I use as m & b.
I am very disappointed in myself because I can't remember, but alas I am asking for help. I tried looking for the notes on your home page but I couldn't find it any longer and I think it was taken down for the summer.
If you could help me that would be great. Hope your summer months are spent by the pool!!!
Regards,
Eric
Ellen, As for the project. It essentially was a regression to determine the amount of out of state cotton seed a crushing plant would need when their own states current production increased or decreased. It is not very statistically sound since we are only using 5 years worth of data...but it is just a tool in price analysis that we are using to determine a spread between plants that we can buy the cotton seed at.
As for using me...that would be great. Let those impressionable young students see that we are using what they learn on an everyday basis...some more than others...especially me since I deal with prices and trading.
Eric
Example : The scatterplot below shows the calories and sodium content for each of 17 brands of meat hot dogs.
a) Describe the main features of the relationship.
Calories
100 120 140 160 180 200
Sodium content
600
500
400
300
200
100
b) What is the correlation between calories and sodium?
c) Report the least-squares regression line.
Model Sum maryb
.863a^ .745 .728 48.
Model 1
R R Square
Adjusted R Square
Std. Error of the Estimate
a. Predictors: (Constant), Calories b. Dependent Variable: Sodium content
Correlations
1 .863**
.. 17 17 .863** 1 .. 17 17
Pearson Correlation Sig. (2-tailed) N Pearson Correlation Sig. (2-tailed) N
Calories
Sodium content
Calories
Sodium cont ent
**. Correlation is significant at the 0. 01 level (2-tailed).
g) Leave off the outlier, and recalculate the correlation and another least- squares regression line. Is your outlier influential? Explain your answer.
h) If there is a new brand of meat hot dog with 150 calories per frank, how many milligrams of sodium do you estimate that one of these hotdogs contains?
Correlations
1 .834**
.. 16 16 .834** 1 .. 16 16
Pearson Correlation Sig. (2-tailed) N Pearson Correlation Sig. (2-tailed) N
cal
sod
cal2 sod
Correlation is significant at the 0. 01 level (2-tailed).
**.
Model Sum maryb
.834a^ .695 .674 36.
Model 1
R R Square
Adjusted R Square
Std. Error of the Estimate
a. Predictors: (Constant), cal b. Dependent Variable: sod
Coe fficientsa
46.900 69.371 .676 .510 -101.886 195. 2.401 .425 .834 5.653 .000 1.490 3.
(Constant) cal
Model 1
B Std. Error
Uns tandardized Coefficients Beta
Standardized Coefficients t Sig. Lower Bound Upper Bound
95% Confidence Interval for B
a. Dependent Variable: sod