🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

Lecture 14 & 15_Regression and correlation_2022.pdf

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

Introduction to Correlation and Regression Analyses [PSM 201/PSM 401/EMS 300] R. F. AFOLABI, PhD Department of Epidemiology and Medical Statistics, University of Ibadan Correlation & Regression...

Introduction to Correlation and Regression Analyses [PSM 201/PSM 401/EMS 300] R. F. AFOLABI, PhD Department of Epidemiology and Medical Statistics, University of Ibadan Correlation & Regression analysis_2022 1 Learning Objectives Compute and Interpret a Pearson correlation coefficient Compute and Interpret a Spearman rank correlation coefficient Describe the purpose and use of linear regression models Calculate a simple linear regression model given two related variables Correlation & Regression analysis_2022 22 Preamble – What can you say about this diagram? Y 0 X Correlation & Regression analysis_2022 33 Scatter diagram /plot It is a way to display the relationship between two variables, say x and y,graphically It is the most common and easiest way of displaying visual picture of possible association between Y and X It shows the direction and strength of a relationship between the variables May not be useful for large sample sizes – Relationships may be difficult to see with lots of points Correlation & Regression analysis_2022 analysis_PSM_2016/17 Session 44 Scatter diagram … 2 PERFECT NEGATIVE Y Y PERFECTPOSITIVE 0 X 0 X NO OR ZERO CORRELATION NO OR ZERO CORRELATION Y Y 0 X 0 X Correlation & Regression analysis_2022 55 Scatter diagram … 3 PARTIAL NEGATIVE Y Y PARTIAL POSITIVE 0 X 0 X NO OR ZERO LINEAR NO OR ZERO LINEAR Y CORRELATION Y CORRELATION 0 X 0 X Correlation & Regression analysis_2022 66 What is correlation? Numerical measure of the degree or extent of linear relationship between two quantitative variables X and Y Correlation measures the degree to which two variables are related or associated ✓It measures the strength of the association between two variables Correlation & Regression analysis_2022 77 EXAMPLES: Height andWeight. Periodontal disease in the Left and Right ventricle. Age and Heart disease. Circumference of head and Academic performance. Body Mass Index and Blood pressure, etc. Correlation & Regression analysis_2022 88 Correlation Coefficients, rho (r) Correlation can be measured using: 1. Pearson product moment correlation coefficient 2. Spearman’s rank correlation coefficient 6Σd2 r= 1- n(n2 -1) Correlation & Regression analysis_2022 9 Pearson Correlation Coefficient Measure of the strength of the linear association between two continuous variables The correlation coefficient, r, developed by Karl Pearson, is a numerical measure of the strength of association between the two variables expressed as: Correlation & Regression analysis_2022 10 How variables change relative to one another Suppose we have two variables: X and Y Positive – Both variables change in the same direction Negative – As one variable changes, the other moves in the opposite direction The sign of the coefficient indicates the direction of the association, direct (positive) or inverse (negative) Coefficient can take on any valueCorrelation between -1 to +1 & Regression analysis_2022 11 Correlation coefficient (r) thermometer 1 HIGH POSITIVE + 0.5 0 NO Correlation ─ 0.5 1 HIGH NEGATIVE Correlation & Regression analysis_2022 12 Pearson’s Correlation Coefficient (r) What the VALUE of r tells us: The value of r is always between -1 and +1 The size of the correlation r indicates the strength of the linear relationship between x and y. Values of r close to -1 or to +1 indicate a stronger linear relationship between x and y. If r = 0 there is absolutely no linear relationship between x and y (no linear correlation). If r = 1, there is perfect positive correlation. If r = -1, there is perfect negative correlation. Correlation & Regression analysis_2022 13 Pearson’s Correlation Coefficient (r) What the S I G N of r tells us A positive value of r means that when x increases, y tends to increase and when x decreases, y tends to decrease (positive correlation) A negative value of r means that when x increases, y tends to decrease and when x decreases, y tends to increase (negative correlation) The sign of r is the same as the sign of the slope, b, of the best fit line. Correlation & Regression analysis_2022 14 Positive Correlation Coefficient +1: perfect positive correlation ◦ As X ↑,Y ↑ ◦ As X ↓,Y ↓ Correlation & Regression analysis_2022 15 Negative Correlation Coefficient -1: perfect negative correlation ◦ As X ↑,Y ↓ ◦ As X ↓,Y ↑ Correlation & Regression analysis_2022 16 Correlation Coefficient of 0 r=0: no correlation ◦ There is no relationship between X and Y ◦ Or, there may be a relationship but it is is nonlinear Correlation & Regression analysis_2022 17 No Correlation Correlation & Regression analysis_2022 18 Example:1 The ages and time taken for cessation bleeding among 10 accident victims are as shown in the table below: Age (yrs) 29 15 21 22 20 25 27 19 24 21 Time 15 23 22 19 19 18 21 24 17 16 (mins) Examine the type of relationship between the variables using both Pearson’s product moment and Spearman rank correlation coefficients. Correlation & Regression analysis_2022 19 So luti on 2 X Y XY X2 Y2 (nΣxy ─ ΣxΣy) 29 15 435 841 225 r= 15 21 23 22 √ {nΣx2 - (Σx)2} {nΣy2-(Σy)2} 22 19 20 19 (10x4257 ─ 223x194) 25 18 = 27 19 21 24 √ {10x5123-(223)2}{10x3846 - (194)2} ─ 692 24 17 = 21 223 16 194 4257 5123 3846 √ {824} {1501} = ─ 0.62 Correlation & Regression analysis_2022 20 Solution 1 X Y RX RY d = R X - RY d2 29 15 10 1 9 81 15 23 1 9 -8 21 22 4.5 8 -3.5 22 19 6 5.5 0.5 20 19 3 5.5 -2.5 25 18 8 4 4 27 21 9 7 2 19 24 2 10 -8 24 17 7 3 4 21 16 4.5 2 2.5 270 Correlation & Regression analysis_2022 Correlation_PAU_2018 21 6 d 2 r =1− n(n 2 − 1) 6(270) r = 1− = −0.6363 10(10 −1) 2 Interpret??? Correlation & Regression analysis_2022 Correlation_PAU_2018 22 Coefficient of Determination The square of correlation coefficient r (i.e., r2) is the same as the coefficient of determination It tells us the proportion of variability in the response variable as a result of the predictor variable(s) E.rg.,= −0.6222  r 2 = 0.3871 Interpret??? Correlation & Regression analysis_2022 Correlation_PAU_2018 23 40 What is a Linear Regression? ▪It is a statistical technique of finding a straight line that summarizes the information in a group of data points –to know how two or more numeric variables are related ▪Types of regression –Simple linear regression –Multiple linear regression –Logistic regression Correlation & Regression analysis_2022 24 Simple Linear Regression ▪Linear Regression performed with a single predictor is called Simple Linear Regression ▪Simple Linear Regression quantifies the association between two variables ▪Its purpose is to use data to estimate the form of any relationship Correlation & Regression analysis_2022 25 Simple Linear Regression Equation ✓ Evaluation of relationship between 2 variables ✓ “Best fit line” ✓ Results in an equation: Correlation & Regression analysis_2022 26 Example Sample of 10 patients Patient SBP DBP Systolic blood 1 110 65 pressure (SBP) 2 124 70 Diastolic blood 3 116 75 pressure (DBP) 4 120 80 5 135 85 Is there a relationship 6 148 90 between SBP and 7 136 95 DBP? 8 165 100 9 152 105 10 172 110 Correlation & Regression analysis_2022 27 Simple Linear Regression Equation Mathematical description of the Y and X relationship Y = β0 + β1(X) Y = intercept + slope*(X) – β1=o, implies that there is no association – β1>o, implies a direct/positiveassociation – β1

Use Quizgecko on...
Browser
Browser