Reasoning in Psychology Using Statistics Psychology 138 2018

  • Slides: 38
Download presentation
Reasoning in Psychology Using Statistics Psychology 138 2018

Reasoning in Psychology Using Statistics Psychology 138 2018

 • Quiz 8 due Fri. Apr 20 – Includes both correlation and regression

• Quiz 8 due Fri. Apr 20 – Includes both correlation and regression • Final Project due date Wed. May 2 nd Announcements Reasoning in Psychology Using Statistics

 • Lecture Exam 3 • Lab Exam 3 – Mean 49. 2 (49.

• Lecture Exam 3 • Lab Exam 3 – Mean 49. 2 (49. 2/75 = 65. 6%) • Combined Exam 3 – Mean 106. 1 (= 70. 7%) (artificially a little low because of some ‘ 0’s’ from students who didn’t show up or schedule a make-up exam) Exam(s) 3 Reasoning in Psychology Using Statistics – Mean 56. 9 (56. 9/75 = 75. 9%)

 • Regression procedures can be used to predict the response variable based on

• Regression procedures can be used to predict the response variable based on the explanatory variable(s) Suppose that you notice that the more you study for an exam, the better your score typically is. – This suggests that there is a relationship between the variables. – You can use this relationship to predict test performance based on study time 115 mins Regression Reasoning in Psychology Using Statistics test performance

 • Regression – Describing the nature of the relationship between variables for the

• Regression – Describing the nature of the relationship between variables for the purposes of prediction Two variables Relationship between variables Quantitative variables Decision tree Reasoning in Psychology Using Statistics Making predictions based on form of the relationship

 • For correlation: “it doesn’t matter which variable goes on the X-axis or

• For correlation: “it doesn’t matter which variable goes on the X-axis or the Y-axis” Predicted variable • For regression this is NOT the case Y 6 5 – The variable that you are predicting (response variable) goes on the Y-axis Quiz 4 performance 3 2 1 1 2 Hours of study 3 4 5 Predictor variable Regression Reasoning in Psychology Using Statistics 6 X – The variable that you are making the prediction based on (explanatory variable) goes on the X-axis

 • For correlation: “Imagine a line through the points” • But there are

• For correlation: “Imagine a line through the points” • But there are lots of possible lines Y 6 5 Quiz 4 performance 3 2 1 1 2 3 4 5 Hours of study Regression Reasoning in Psychology Using Statistics 6 • One line is the “best fitting line” • Today: learn how to compute the equation corresponding to this “best fitting line” X

 • A brief review of geometry Y = intercept, when X = 0

• A brief review of geometry Y = intercept, when X = 0 Y 6 5 Y = (X)(slope) + (intercept) 4 3 2 1 0 2. 0 1 2 3 4 5 Regression Reasoning in Psychology Using Statistics 6 X

 • A brief review of geometry Y 6 5 Y = (X)(slope) +

• A brief review of geometry Y 6 5 Y = (X)(slope) + (intercept) 4 3 2 1 0. 5 2 1 2 3 Change in Y 4 5 Regression Reasoning in Psychology Using Statistics 6 X Change in X 2. 0 = slope

 • A brief review of geometry Y 6 5 Y = (X)(slope) +

• A brief review of geometry Y 6 5 Y = (X)(slope) + (intercept) Y = (X)(0. 5) + 2. 0 4 3 2 1 0 1 2 3 4 5 Regression Reasoning in Psychology Using Statistics 6 X – In regression analysis this line (or the equation that describes it) represents our predicted values of Y given particular values of X

 • A brief review of geometry • Consider a perfect correlation X=5 4.

• A brief review of geometry • Consider a perfect correlation X=5 4. 5 Y 6 5 Y = (X)(0. 5) + (2. 0) Y=? Y = (5)(0. 5) + (2. 0) 4 3 2 1 1 2 3 4 5 Regression Reasoning in Psychology Using Statistics 6 X Y = 2. 5 + 2 = 4. 5 • Can make specific predictions about Y based on X

 • Consider a less than perfect correlation • The line still represents the

• Consider a less than perfect correlation • The line still represents the predicted values of Y given X X=5 4. 5 Y 6 5 Y = (X)(0. 5) + (2. 0) Y=? Y = (5)(0. 5) + (2. 0) 4 3 2 1 Y = 2. 5 + 2 = 4. 5 1 2 3 4 5 Regression Reasoning in Psychology Using Statistics 6 X

 • Least squares regression – The “best fitting line” is the one that

• Least squares regression – The “best fitting line” is the one that minimizes the differences (error or residuals) between the predicted scores (the line) and the actual scores (the points) Y 6 5 • Rather than compare the errors from different lines and picking the best, we will directly compute the equation for the best fitting line 4 3 2 1 1 2 3 4 5 Regression Reasoning in Psychology Using Statistics 6 X

 • Using the dataset from our correlation lecture Suppose that you notice that

• Using the dataset from our correlation lecture Suppose that you notice that the more you study for an exam (X= hours of study), the better your exam score typically is (Y = exam score). Compute the regression equation predicting exam score with study time. X Y A 6 6 B 1 2 C 5 6 D 3 4 E 3 2 Example Reasoning in Psychology Using Statistics Y 6 5 4 3 2 1 1 2 3 4 5 6 X

Suppose that you notice that the more you study for an exam (X= hours

Suppose that you notice that the more you study for an exam (X= hours of study), the better your exam score typically is (Y = exam score). Compute the regression equation predicting exam score with study time. X Y A 6 6 2. 4 B 1 2 C 5 D 3 E 5. 2 1. 96 2. 0 4. 0 2. 8 -0. 6 0. 36 0. 0 -0. 6 0. 0 0. 36 15. 20 -2. 0 SSX 0. 0 4. 0 16. 0 1. 2 14. 0 6 1. 4 4 Example Reasoning in Psychology Using Statistics 4. 8 -2. 0 -2. 6 3 2 mean 3. 6 4. 0 2. 0 4. 0 5. 76 6. 76 SSY SP

Suppose that you notice that the more you study for an exam (X= hours

Suppose that you notice that the more you study for an exam (X= hours of study), the better your exam score typically is (Y = exam score). Compute the regression equation predicting exam score with study time. X Y A 6 6 B 1 2 C 5 6 D 3 4 E 3 2 mean 3. 6 4. 0 15. 20 Example Reasoning in Psychology Using Statistics SSX 16. 0 SSY 14. 0 SP

Suppose that you notice that the more you study for an exam (X= hours

Suppose that you notice that the more you study for an exam (X= hours of study), the better your exam score typically is (Y = exam score). Compute the regression equation predicting exam score with study time. X Y A 6 6 B 1 2 C 5 6 D 3 4 E 3 2 mean 3. 6 4. 0 15. 20 Example Reasoning in Psychology Using Statistics SSX 16. 0 SSY 14. 0 SP

Suppose that you notice that the more you study for an exam (X= hours

Suppose that you notice that the more you study for an exam (X= hours of study), the better your exam score typically is (Y = exam score). Compute the regression equation predicting exam score with study time. X Y A 6 6 B 1 2 C 5 6 D 3 4 E 3 2 mean 3. 6 4. 0 Y 6 5 4 3 2 1 1 Example Reasoning in Psychology Using Statistics 2 3 4 5 6 X

Suppose that you notice that the more you study for an exam (X= hours

Suppose that you notice that the more you study for an exam (X= hours of study), the better your exam score typically is (Y = exam score). Compute the regression equation predicting exam score with study time. X Y A 6 6 B 1 2 C 5 6 D 3 4 E 3 2 mean 3. 6 4. 0 Y The two means will be on the line 6 5 4 3 2 1 1 Example Reasoning in Psychology Using Statistics 2 3 4 5 6 X

Suppose that you notice that the more you study for an exam (X= hours

Suppose that you notice that the more you study for an exam (X= hours of study), the better your exam score typically is (Y = exam score). Compute the regression equation predicting exam score with study time. X Y A 6 6 B 1 2 C 5 6 D 3 4 E 3 2 mean 3. 6 4. 0 Y 6 5 4 3 Hypothesis testing 2 of these on each 1 1 Example Reasoning in Psychology Using Statistics 2 3 4 5 6 X

 • SPSS Regression output gives you a lot of stuff Hypothesis testing with

• SPSS Regression output gives you a lot of stuff Hypothesis testing with Regression Reasoning in Psychology Using Statistics

 • SPSS Regression output gives you a lot of stuff Make sure you

• SPSS Regression output gives you a lot of stuff Make sure you put the variables in the correct role Hypothesis testing with Regression Reasoning in Psychology Using Statistics

 • SPSS Regression output gives you a lot of stuff • Unstandardized coefficients

• SPSS Regression output gives you a lot of stuff • Unstandardized coefficients – “(Constant)” = intercept – Variable name = slope • These t-tests test hypotheses – H 0: Intercept (constant) = 0 – H 0: Slope = 0 Hypothesis testing with Regression Reasoning in Psychology Using Statistics

 • The linear equation isn’t the whole thing – Also need a measure

• The linear equation isn’t the whole thing – Also need a measure of error Y = X(. 5) + (2. 0) + error • Same line, but different relationships (strength difference) Y = X(. 5) + (2. 0) + error Y 6 5 4 3 2 1 1 2 3 4 5 6 X Measures of Error in Regression Reasoning in Psychology Using Statistics

 • The linear equation isn’t the whole thing • Also need a measure

• The linear equation isn’t the whole thing • Also need a measure of error • Three common measures of error – r 2 (r-squared) – Sum of the squared residuals = SSresidual= SSerror – Standard error of estimate Measures of Error in Regression Reasoning in Psychology Using Statistics by Jim: Standard Error of the Regression vs. R-squared

 • R-squared (r 2) represents the percent variance in Y accounted for by

• R-squared (r 2) represents the percent variance in Y accounted for by X r = 0. 8 Y 6 5 r 2 = 0. 64 r = 0. 5 r 2 = 0. 25 64% of the variance in Y is explained by X 4 3 2 1 Y 6 5 25% of the variance in Y is explained by X 4 3 2 1 1 2 3 4 5 6 X Measures of Error in Regression Reasoning in Psychology Using Statistics

 • Sum of the squared residuals = SSresidual = SSerror Y 6 5

• Sum of the squared residuals = SSresidual = SSerror Y 6 5 4 3 2 1 1 2 3 4 5 6 X • Compute the difference between the predicted values and the observed values (“residuals”) • Square the differences • Add up the squared differences Measures of Error in Regression Reasoning in Psychology Using Statistics

 • Sum of the squared residuals = SSresidual = SSerror X 6 1

• Sum of the squared residuals = SSresidual = SSerror X 6 1 5 3 Y 6 2 6 4 3 2 mean 3. 6 4. 0 Predicted values of Y (points on the line) Measures of Error in Regression Reasoning in Psychology Using Statistics

 • Sum of the squared residuals = SSresidual = SSerror X 6 1

• Sum of the squared residuals = SSresidual = SSerror X 6 1 5 3 Y 6 2 6 4 6. 2 = (0. 92)(6)+0. 688 3 2 mean 3. 6 4. 0 Predicted values of Y (points on the line) Measures of Error in Regression Reasoning in Psychology Using Statistics

 • Sum of the squared residuals = SSresidual = SSerror X 6 1

• Sum of the squared residuals = SSresidual = SSerror X 6 1 5 3 Y 6 2 6 4 3 2 mean 3. 6 4. 0 6. 2 1. 6 = (0. 92)(6)+0. 688 = (0. 92)(1)+0. 688 5. 3 = (0. 92)(5)+0. 688 3. 45 = (0. 92)(3)+0. 688 Measures of Error in Regression Reasoning in Psychology Using Statistics

 • Sum of the squared residuals = SSresidual = SSerror X 6 1

• Sum of the squared residuals = SSresidual = SSerror X 6 1 5 3 Y 6 2 6 4 3 2 6. 2 1. 6 5. 3 3. 45 Y 6. 2 6 5. 3 5 4 3. 45 3 2 1. 6 1 1 2 3 4 5 6 X These are all points on the prediction line Measures of Error in Regression Reasoning in Psychology Using Statistics

 • Sum of the squared residuals = SSresidual = SSerror X 6 1

• Sum of the squared residuals = SSresidual = SSerror X 6 1 5 3 Y 6 2 6 4 3 2 mean 3. 6 4. 0 residuals 6. 2 1. 6 5. 3 3. 45 -0. 20 2 - 1. 6 = 0. 40 6 - 5. 3 = 0. 70 4 - 3. 45 = 0. 55 2 - 3. 45 = -1. 45 Quick check 0. 00 6 - 6. 2 = These are deviations between the points on the prediction line and the actual observed values (in the Y direction) Measures of Error in Regression Reasoning in Psychology Using Statistics

 • Sum of the squared residuals = SSresidual = SSerror X 6 1

• Sum of the squared residuals = SSresidual = SSerror X 6 1 5 3 residuals Y 6 2 6 4 6. 2 1. 6 5. 3 3. 45 3 2 mean Y 3. 6 4. 0 6. 2 6 5. 3 5 These are deviations between the points on the prediction line and the actual observed values (in the Y direction) 4 3. 45 1. 6 3 2 1 Reasoning in Psychology Using 1 Statistics 2 -0. 20 2 - 1. 6 = 0. 40 6 - 5. 3 = 0. 70 4 - 3. 45 = 0. 55 2 - 3. 45 = -1. 45 Quick check 0. 00 6 - 6. 2 = Measures of Error in Regression 3 4 5 6 X

 • Sum of the squared residuals = SSresidual = SSerror X 6 1

• Sum of the squared residuals = SSresidual = SSerror X 6 1 5 3 Y 6 2 6 4 3 2 mean 3. 6 4. 0 6. 2 1. 6 5. 3 3. 45 -0. 20 0. 40 0. 70 0. 55 -1. 45 0. 00 0. 04 0. 16 0. 49 0. 30 2. 10 3. 09 SSERROR Measures of Error in Regression Reasoning in Psychology Using Statistics

 • Sum of the squared residuals = SSresidual = SSerror X 6 1

• Sum of the squared residuals = SSresidual = SSerror X 6 1 5 3 Y 6 2 6 4 3 2 mean 3. 6 4. 0 6. 2 1. 6 5. 3 3. 45 4. 0 -0. 20 0. 40 0. 70 0. 55 -1. 45 0. 00 4. 0 0. 0 4. 0 16. 0 SSY 0. 04 0. 16 0. 49 0. 30 2. 10 3. 09 SSERROR Don’t get these confused with each other Measures of Error in Regression Reasoning in Psychology Using Statistics

 • Standard error of the estimate represents the average deviation from the line

• Standard error of the estimate represents the average deviation from the line Y 6 5 4 3 2 1 df = n - 2 1 2 3 4 5 6 X Measures of Error in Regression Reasoning in Psychology Using Statistics

 • SPSS Regression output gives you a lot of stuff • r 2

• SPSS Regression output gives you a lot of stuff • r 2 – percent variance in Y accounted for by X • Standard error of the estimate – the average deviation from the line • SSresiduals or SSerror Measures of Error in Regression Reasoning in Psychology Using Statistics

 • You’ll practice computing the regression equation and error for the “best fitting

• You’ll practice computing the regression equation and error for the “best fitting line” (by hand using SPSS) • • Statistics. Fun • Introduction to Regression: https: //www. youtube. com/watch? v=z. PG 4 Nj. Ik. Cjc • Bivariate regression by hand: https: //www. youtube. com/watch? v=Jv. S 2 tri. Cg. OY • Error: R-squared by hand: https: //www. youtube. com/watch? v=w 2 FKXOa 0 HGA Bivariate regression by hand: https: //www. youtube. com/watch? v=l. WEn 1 g. HEZkk Bivariate regression in SPSS: https: //www. youtube. com/watch? v=Elk. CTFk. AGXY Simple Linear Regression in Comics: https: //www. youtube. com/watch? v=l. Z 72 O-d. Xht. M In lab Reasoning in Psychology Using Statistics