Linear Regression Chapter 7. Slide 2 What is Regression? A way of predicting the value of one variable from another. – It is a hypothetical model of the.

Slides:



Advertisements
Similar presentations
Regression single and multiple. Overview Defined: A model for predicting one variable from other variable(s). Variables:IV(s) is continuous, DV is continuous.
Advertisements

Simple Linear Regression 1. Correlation indicates the magnitude and direction of the linear relationship between two variables. Linear Regression: variable.
Some Terms Y =  o +  1 X Regression of Y on X Regress Y on X X called independent variable or predictor variable or covariate or factor Which factors.
Chapter 13 Multiple Regression
LINEAR REGRESSION: Evaluating Regression Models Overview Assumptions for Linear Regression Evaluating a Regression Model.
LINEAR REGRESSION: Evaluating Regression Models. Overview Assumptions for Linear Regression Evaluating a Regression Model.
© 2005 The McGraw-Hill Companies, Inc., All Rights Reserved. Chapter 14 Using Multivariate Design and Analysis.
Chapter 12 Multiple Regression
Multivariate Data Analysis Chapter 4 – Multiple Regression.
Lecture 6: Multiple Regression
Multiple Regression.
Biol 500: basic statistics
Lecture 5: Simple Linear Regression
Multiple Regression Research Methods and Statistics.
Summary of Quantitative Analysis Neuman and Robson Ch. 11
Multiple Regression Dr. Andy Field.
Simple Linear Regression Analysis
Relationships Among Variables
Basic Analysis of Variance and the General Linear Model Psy 420 Andrew Ainsworth.
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 13-1 Chapter 13 Introduction to Multiple Regression Statistics for Managers.
CHAPTER 5 REGRESSION Discovering Statistics Using SPSS.
Leedy and Ormrod Ch. 11 Gray Ch. 14
Marketing Research Aaker, Kumar, Day and Leone Tenth Edition
Selecting the Correct Statistical Test
Elements of Multiple Regression Analysis: Two Independent Variables Yong Sept
Copyright © 2010 Pearson Education, Inc Chapter Seventeen Correlation and Regression.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Chapter 15 Multiple Regression n Multiple Regression Model n Least Squares Method n Multiple.
Soc 3306a Multiple Regression Testing a Model and Interpreting Coefficients.
Simple Linear Regression One reason for assessing correlation is to identify a variable that could be used to predict another variable If that is your.
Soc 3306a Lecture 9: Multivariate 2 More on Multiple Regression: Building a Model and Interpreting Coefficients.
Multiple Regression The Basics. Multiple Regression (MR) Predicting one DV from a set of predictors, the DV should be interval/ratio or at least assumed.
Regression Analyses. Multiple IVs Single DV (continuous) Generalization of simple linear regression Y’ = b 0 + b 1 X 1 + b 2 X 2 + b 3 X 3...b k X k Where.
Regression Chapter 16. Regression >Builds on Correlation >The difference is a question of prediction versus relation Regression predicts, correlation.
Regression Lesson 11. The General Linear Model n Relationship b/n predictor & outcome variables form straight line l Correlation, regression, t-tests,
Chapter 16 Data Analysis: Testing for Associations.
Chapter 13 Multiple Regression
© 2006 by The McGraw-Hill Companies, Inc. All rights reserved. 1 Chapter 12 Testing for Relationships Tests of linear relationships –Correlation 2 continuous.
 Relationship between education level, income, and length of time out of school  Our new regression equation: is the predicted value of the dependent.
Linear Regression Chapter 8. Slide 2 What is Regression? A way of predicting the value of one variable from another. – It is a hypothetical model of the.
ANCOVA. What is Analysis of Covariance? When you think of Ancova, you should think of sequential regression, because really that’s all it is Covariate(s)
Assumptions 5.4 Data Screening. Assumptions Parametric tests based on the normal distribution assume: – Independence – Additivity and linearity – Normality.
Descriptions. Description Correlation – simply finding the relationship between two scores ○ Both the magnitude (how strong or how big) ○ And direction.
Correlation Chapter 6. What is a Correlation? It is a way of measuring the extent to which two variables are related. It measures the pattern of responses.
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.. Chap 14-1 Chapter 14 Introduction to Multiple Regression Basic Business Statistics 10 th Edition.
Lesson 14 - R Chapter 14 Review. Objectives Summarize the chapter Define the vocabulary used Complete all objectives Successfully answer any of the review.
Copyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Simple Linear Regression Analysis Chapter 13.
4 basic analytical tasks in statistics: 1)Comparing scores across groups  look for differences in means 2)Cross-tabulating categoric variables  look.
© 2011 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license.
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.Chap 14-1 Statistics for Managers Using Microsoft® Excel 5th Edition Chapter.
 Seeks to determine group membership from predictor variables ◦ Given group membership, how many people can we correctly classify?
Applied Quantitative Analysis and Practices LECTURE#28 By Dr. Osman Sadiq Paracha.
Continuous Outcome, Dependent Variable (Y-Axis) Child’s Height
Biostatistics Regression and Correlation Methods Class #10 April 4, 2000.
Between-Groups ANOVA Chapter 12. Quick Test Reminder >One person = Z score >One sample with population standard deviation = Z test >One sample no population.
Chapter 11 REGRESSION Multiple Regression  Uses  Explanation  Prediction.
Data Screening. What is it? Data screening is very important to make sure you’ve met all your assumptions, outliers, and error problems. Each type of.
Regression. Why Regression? Everything we’ve done in this class has been regression: When you have categorical IVs and continuous DVs, the ANOVA framework.
Chapter 12: Correlation and Linear Regression 1.
Chapter 14 Introduction to Multiple Regression
Multiple Regression Prof. Andy Field.
Psych 706: stats II Class #7.
Analysis of Covariance, ANCOVA (GLM2)
Multiple Regression.
Linear Regression Prof. Andy Field.
Regression.
Correlation and Simple Linear Regression
Multiple Regression – Part II
CHAPTER 29: Multiple Regression*
Correlation and Simple Linear Regression
3 basic analytical tasks in bivariate (or multivariate) analyses:
Presentation transcript:

Linear Regression Chapter 7

Slide 2 What is Regression? A way of predicting the value of one variable from another. – It is a hypothetical model of the relationship between two variables. – The model used is a linear one. – Therefore, we describe the relationship using the equation of a straight line.

Model for Correlation Outcome i = (bX i ) + error i – Remember we talked about how b is standardized (correlation coefficient, r) to be able to tell the strength of the model – Therefore, r = model+strength instead of M + error.

Slide 4 Describing a Straight Line b i – Regression coefficient for the predictor – Gradient (slope) of the regression line – Direction/Strength of Relationship b 0 – Intercept (value of Y when X = 0) – Point at which the regression line crosses the Y- axis (ordinate)

Intercepts and Gradients

Types of Regression Simple Linear Regression = SLR – One X variable (IV) Multiple Linear Regression = MLR – 2 or more X variables (IVs)

Types of Regression MLR Types – Simultaneous Everything at once – Hierarchical IVs in steps – Stepwise Statistical regression (not recommended)

Analyzing a regression Is my overall model (i.e. the regression equation) useful at predicting the outcome variable? – Model summary, ANOVA, R 2 How useful are each of the individual predictors for my model? – Coefficients, t-test, pr 2

Overall Model Remember that ANOVA was a subtraction of different types of information – SStotal = My score – Grand Mean – SSmodel = My level – Grand Mean – SSresidual = My score – My level – (for one-way ANOVAs) This method is called least squares

Slide 10 The Method of Least Squares

Slide 11 Sums of Squares

Slide 12 Summary SS T – Total variability (variability between scores and the mean). – My score – Grand mean SS R – Residual/Error variability (variability between the regression model and the actual data). – My score – my predicted score SS M – Model variability (difference in variability between the model and the mean). – My predicted score – Grand mean

Slide 13 Overall Model: ANOVA If the model results in better prediction than using the mean, then we expect SS M to be much greater than SS R SS R Error in Model SS M Improvement Due to the Model SS T Total Variance In The Data

Slide 14 Overall Model: R 2 R 2 – The proportion of variance accounted for by the regression model. – The Pearson Correlation Coefficient Squared

Individual Predictors We test the individual predictors with a t-test. – Think about ANOVA > post hocs … this order follows the same pattern. Single sample t-test to determine if the b value is greater than zero – (test statistic = b / SE) = also the same thing we’ve been doing … model / error

Individual Predictors t values are traditionally reported, but the df aren’t obvious in R. df = N – k – 1 N = total sample size, k = number of predictors – So correlation = N – 1 – 1 = N – 2 – (what we did last week) – Also dfresidual

Individual Predictors b = unstandardized regression coefficient – For every one unit increase in X, there will be b units increase in Y. Beta = standardized regression coefficient – b in standard deviation units. – For every one SD increase in X, there will be b SDs increase in Y.

Individual Predictors b or beta? Depends: – b is more interpretable given your specific problem – Beta is more interpretable given differences in scales for different variables

Data Screening Now we want to look specifically at the residuals for Y … while screening the X variables We used a random variable before to check the continuous variable (the DV) to make sure they were randomly distributed

Data Screening Now we don’t need the random variable because the residuals for Y should be randomly distributed (and evenly) with the X variable So we get to data screen with a real regression – (rather than the fake one used with ANOVA).

Data Screening Missing and accuracy are still screened in the same way Outliers – (somewhat) new and exciting! Multicollinearity – same procedure** Linearity, Normality, Homogeneity, Homoscedasticity – same procedure (but now on the real regression)

Example C7 regression data – CESD = depression measure – PIL total = measure of meaning in life – AUDIT total = measure of alcoholism – DAST total = measure of drug usage CESD = AUDIT + PIL

Multiple Regression

Run the Regression You know that LM function we’ve been using? Yes! You get to use it again. Same Y ~ X + X format we’ve been using.

Data Screening First, let’s do Mahalanobis – Same rules apply with mahalanobis() function – But now we are going to save a column of data that includes if they are above the cut off score or not.

Data Screening Outliers – Leverage – influence of that person on the slope What do these numbers mean? – Cut off = (2K+2)/N To get them in R – hatvalues(model)

Data Screening Outliers – Influence (Cook’s values) – a measure of how much of an effect that single case has on the whole model – Often described as leverage + discrepancy What do the numbers mean? – Cut off = 4/(N-K-1) To get them in R – cooks.distance(model)

Data Screening What do I do with all these numbers?! – Screen those bad boys, and add it up! – Subset out the bad people!

Data Screening Multicollinearity – You want X and Y to be correlated – You do not want the Xs to be highly correlated It’s a waste of power (dfs)

Data Screening Linearity Normality Homogeneity Homoscedasticity

What to do? If your assumptions go wrong: – Linearity – try nonlinear regression or nonparametric regression – Normality – more subjects, still fairly robust – Homogeneity/Homoscedasticity – bootstrapping

Overall Model After data screening, we want to know if our regression worked! – Start with the overall model – is it significant? – summary(model) F(2, 258) = 54.77, p <.001, R 2 =.30

What about the predictors? Look in the coefficients section. Meaning was significant, b = -0.37, t(258) = , p <.001 Alcohol was not, b = 0.001, t(258) = 0.01, p =.99

Predictors Two concerns: – What if I wanted to use beta because these are very different scales? – What about an effect size for each individual predictor?

Predictors - Beta You will need the QuantPsyc package for beta. lm.beta(model)

R Multiple correlations = R All overlap in Y – A+B+C/A+B+C+D DV Variance IV 1 IV 2 A B C D

SR DV Variance IV 1 IV 2 A B C D Semipartial correlations = sr Unique contribution of IV to R2 for those IVs – Increase in proportion of explained Y variance when X is added to the equation – A/A+B+C+D

PR DV Variance IV 1 IV 2 A B C D Partial correlation = pr – Proportion in variance in Y not explained by other predictors but this X only – A/D – Pr > sr

Predictors - Partials Remember to square them! New code, so you don’t forget: partials = pcor(dataset) partials$estimate^2

Predictors - Partials Meaning was significant, b = -0.37, t(258) = , p <.001, pr 2 =.29 Alcohol was not, b = 0.001, t(258) = 0.01, p =.99, pr 2 <.01

Hierarchical Regression Dummy Coding

Hierarchical Regression Known predictors (based on past research) are entered into the regression model first. New predictors are then entered in a separate step/block. Experimenter makes the decisions.

Hierarchical Regression It is the best method: – Based on theory testing. – You can see the unique predictive influence of a new variable on the outcome because known predictors are held constant in the model. Bad Point: – Relies on the experimenter knowing what they’re doing!

Hierarchical Regression Answers the following questions: – Is my overall model significant? – Is the addition of each step significant? – Are the individual predictors significant?

Hierarchical Regression Uses: – When a researcher wants to control for some known variables first. – When a researcher wants to see the incremental value of different variables.

Hierarchical Regression Uses: – When a researcher wants to discuss groups of variables together (SETS  especially good for highly correlated variables). – When a researcher wants to use categorical variables with many categories (use as a SET).

Categorical Predictors So what do you do when you have predictors with more than 2 categories? DUMMY CODING – Cool news: If your variable is factored in R, it does that for you automatically.

Hierarchical/Categorical Predictors Example! – C7 dummy code.sav IVs: – Family history of depression – Treatment for depression (categorical) DV: – Rating of depression after treatment

Hierarchical/Categorical Predictors First model = after ~ family history – Controls for family history before testing if treatment is significant Second model = after ~ family history + treatment – Remember you have to leave in the family history variable or you aren’t actually controlling for it.

Hierarchical/Categorical Predictors Model 1 Model 1 is significant, F(1, 48) = 8.50, p =.005, R 2 =.15 Family history is significant, b =.15, t(48) = 2.92, p =.005, pr 2 =.15

Hierarchical/Categorical Predictors Model 2 – I can see that the overall model is significant – But what if the first model was significant and then this model isn’t actually any better and it’s just overall significant because the first model was. (or basically how one variable runs the show).

Hierarchical/Categorical Predictors Compare models with the anova() function. You want to show the addition of your treatment variable added significantly to the equation. – Basically is the change in R 2 > 0?

Hierarchical/Categorical Predictors Yes, it was significant: – ΔF(4, 44) = 4.99, p =.002, ΔR 2 =.27 So the addition of the treatment set was significant.

Categorical Predictors Remember dummy coding equals: – Control group to coded group – Therefore negative numbers = coded group is lower – Positive numbers = coded group is lower – b = difference in means

Categorical Predictors Placebo < No Treatment Paxil = No Treatment Effexor < No Treatment Cheer Up < No Treatment NOT ALL PAIRWISE

Categorical Predictors You could do pr 2 for each pairwise grouping – (t 2 ) / (t 2 + df) – Or you could calculate cohen’s d, since these are mean comparisons.

Applied Regression Two other analyses we don’t have time to cover  – Mediation – understanding the influence of a third variable on the relationship between X and Y – Moderation – understanding the influence of the interaction of X*X predicting Y. QuantPsyc will do both analyses in a fairly simple way (yay!).