SlideShare a Scribd company logo
1 of 25
Simple Linear Regression:
Step-By-Step
Dan Wellisch
danwellisch@gmail.com
Chicago Technology For Value-Based Healthcare Meetup
https://www.meetup.com/Chicago-Technology-For-Value-Based-Healthcare-
Meetup/
9/26/2017
Acknowledgement: Most of the tables and graphs used for this presentation are those of Brandon
Foltz.
https://www.youtube.com/user/BCFoltz
I highly recommend his material. He is very good at explanations of complex statistical methods.
What is Simple Linear Regression?
Simple Linear Regression is a method used to fit the
best straight line between a set of data points.
After a graph is properly scaled, the data points must
“look” like they would fit a straight line, not a parabola,
or any other shape.
The line is used as a model in order to predict a variable
y from another variable x. A regression line must involve
2 variables, the dependent and the independent variable.
Finding the “best-fit” line is the goal of simple linear regression.
Definitions:
Input, Predictive, Or Independent Variable X – 3 names mean the same thing. This is the variable
whose value that is believed to influence the value of another variable. This variable should not be
dependent on another variable (by definition)
Output, Response, Or Dependent Variable Y – 3 names mean the same thing. This is the variable
whose value that is believed to be influenced by the value of another variable. It is by definition,
dependent on another variable.
Best-Fit Line – Represents our model. It is the line that “best fits” our data points. The line represents the
best estimate of the y value for every given input of x.
Sum Of Squares – An important calculation we will use to find the best-fit line.
One Variable
• Problem: A waiter wants to predict his next tip, but he forgot to record the bill amounts
for previous tips.
• Here is a graph of his tips. The tips is the only variable. Let’s call it the y variable.
• Meal# is not a variable. It is simply used to identify a tip.
y variable
Can we come up with a model for this problem with only 1 variable?
• The only option for our model is to use the mean of the Tips($)
• Tips are on the y access. We would call the mean 𝒚 (y bar).
• The mean for the tip amounts is 10.
• The model for our problem is simply 𝒚 = 10.
• 𝒚 = 10 is our best fit line (represented by bold black line).
𝒚 = 10
• Now, let’s talk about goodness of fit. This will tell us how
good our data points fit the line.
• We need to calculate the residuals (errors) for each point.
-5
+7
+1
-2
+4
-5
𝒚 = 10
-5
+7
+1
-2
+4
-5
𝒚 = 10
• The best fit line is the one that minimizes the sum of the squares of
the residuals (errors).
• The error is the difference between the actual data point and the point on the line.
• SSE (Sum Of Squared Errors) = (-5)2 + 72 + 12 + (-2)2 + 42 + (-5)2 = 120
• SST (Sum Of Squared Total) = SSR (Sum Of Squared Regression) + SSE is the Sum Of Squares Equation.
• Since there is no regression line (as we only have 1 variable), we can not make the SSE any smaller than 120,
because SSR = 0.
Two Variables
The goal of simple linear regression is to create a linear model that minimizes
the sum of squares of the errors (SSE).
From a previous slide: SST (Sum Of Squared Total) = SSR (Sum Of Squared Regression) + SSE
When we have 2 variables, we can create a regression line; and therefore, we can calculate
an SSR > 0. If SSR > 0, then we can reduce SSE. Minimizing the errors means that the line will
fit the data better.
2 variables: One is the dependent variable: y. The other is the independent variable x.
Goal Of Simple Linear Regression
So now, we need to introduce a little math…..
Remember from the previous slide that we want to minimize the SSE.
We write this mathematically this way.:
𝑦 is often referred to as y-hat.
• Repeating the Problem: As a waiter, how do we predict the tips we will receive for service
rendered?
• Let’s say, we didn’t forget to record the bill amount.
Independent Variable (x) Dependent Variable (y)
If we scale the graph according to the data points available, we can then plot the points.
Algebra Of Lines - Slope
Equation Of A Straight Line
Y = mX + b
slope y-intercept
m = (rise/run) = (yj – yi) / (xj – xi)
b is the point where x = 0 and y intersects the y-axis
y
x
xj, yj
•
(0,b)
•xi, yi
run
rise
Think of sy divided by sx as the variation
(resembling change) in Y over the variation in X,
in units of X and Y. Rise Over Run!
Derivation to this
Regression Line - Slope
Let’s create a table of calculations that we can use to calculate the slope of the regression (best-fit) line.
• Now that we have the slope, we can calculate the y-intercept because we know 1 point on the line already
(74,10).
• What do we call 74,10?
• (74,10) is the Centroid.
• For comparison, Excel has calculated the regression equation very close to our manual calculation.
Excel calculation
Meaning of our equation….
SST = SSR + SSE
Summary
The regression line must have an SSE < the SSE of the one variable equation, where y = the mean of the data
values. Otherwise, it is not a good model to predict y, given x.
Remember the Sum Of Squares equation, SST = SSR + SSE.
In our example, 120 is the SSE if we only had the past tips (no bill amounts) to predict our next tip. SSR is 0
as there is no regression line.
When we add an independent variable (the bill amount), the tips becomes the dependent variable and we
can create a regression line. The regression line contributes to the SST and therefore reduces the SSE from 120
to 30.075.
Since 30.075 < 120, our regression line is a better model for predicting future tips.

More Related Content

What's hot

Linear regression
Linear regressionLinear regression
Linear regressionTech_MX
 
Regression Analysis
Regression AnalysisRegression Analysis
Regression AnalysisASAD ALI
 
Linear regression analysis
Linear regression analysisLinear regression analysis
Linear regression analysisNimrita Koul
 
Logistic regression
Logistic regressionLogistic regression
Logistic regressionDrZahid Khan
 
Correlation & Regression Analysis using SPSS
Correlation & Regression Analysis  using SPSSCorrelation & Regression Analysis  using SPSS
Correlation & Regression Analysis using SPSSParag Shah
 
Regression analysis
Regression analysisRegression analysis
Regression analysisSrikant001p
 
Logistic regression with SPSS
Logistic regression with SPSSLogistic regression with SPSS
Logistic regression with SPSSLNIPE
 
Simple Linear Regression (simplified)
Simple Linear Regression (simplified)Simple Linear Regression (simplified)
Simple Linear Regression (simplified)Haoran Zhang
 
Logistic regression
Logistic regressionLogistic regression
Logistic regressionsaba khan
 
Multiple linear regression
Multiple linear regressionMultiple linear regression
Multiple linear regressionJames Neill
 
multiple regression
multiple regressionmultiple regression
multiple regressionPriya Sharma
 
Regression analysis
Regression analysisRegression analysis
Regression analysisbijuhari
 
Regression analysis
Regression analysisRegression analysis
Regression analysisSohag Babu
 

What's hot (20)

Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Linear regression theory
Linear regression theoryLinear regression theory
Linear regression theory
 
Linear regression
Linear regressionLinear regression
Linear regression
 
Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysis
 
Linear regression analysis
Linear regression analysisLinear regression analysis
Linear regression analysis
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Correlation and Regression
Correlation and RegressionCorrelation and Regression
Correlation and Regression
 
Correlation & Regression Analysis using SPSS
Correlation & Regression Analysis  using SPSSCorrelation & Regression Analysis  using SPSS
Correlation & Regression Analysis using SPSS
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Logistic regression with SPSS
Logistic regression with SPSSLogistic regression with SPSS
Logistic regression with SPSS
 
Regression
RegressionRegression
Regression
 
Simple Linear Regression (simplified)
Simple Linear Regression (simplified)Simple Linear Regression (simplified)
Simple Linear Regression (simplified)
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Multiple linear regression
Multiple linear regressionMultiple linear regression
Multiple linear regression
 
multiple regression
multiple regressionmultiple regression
multiple regression
 
Binary Logistic Regression
Binary Logistic RegressionBinary Logistic Regression
Binary Logistic Regression
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Regression analysis on SPSS
Regression analysis on SPSSRegression analysis on SPSS
Regression analysis on SPSS
 

Similar to Simple Linear Regression: Step-By-Step

Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Data Science - Part XII - Ridge Regression, LASSO, and Elastic NetsData Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Data Science - Part XII - Ridge Regression, LASSO, and Elastic NetsDerek Kane
 
Line of best fit lesson
Line of best fit lessonLine of best fit lesson
Line of best fit lessonReneeTorres11
 
Ordinary Least Squares Ordinary Least Squares
Ordinary Least Squares Ordinary Least SquaresOrdinary Least Squares Ordinary Least Squares
Ordinary Least Squares Ordinary Least Squaresfarikaumi777
 
Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...
Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...
Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...Maninda Edirisooriya
 
Bootcamp of new world to taken seriously
Bootcamp of new world to taken seriouslyBootcamp of new world to taken seriously
Bootcamp of new world to taken seriouslykhaled125087
 
Grade 9 U0-L5-Graphing
Grade 9 U0-L5-GraphingGrade 9 U0-L5-Graphing
Grade 9 U0-L5-Graphinggruszecki1
 
Regression Analysis.pptx
Regression Analysis.pptxRegression Analysis.pptx
Regression Analysis.pptxShivankAggatwal
 
REGRESSION METasdfghjklmjhgftrHODS1.pptx
REGRESSION METasdfghjklmjhgftrHODS1.pptxREGRESSION METasdfghjklmjhgftrHODS1.pptx
REGRESSION METasdfghjklmjhgftrHODS1.pptxcajativ595
 
Regression Analysis.pptx
Regression Analysis.pptxRegression Analysis.pptx
Regression Analysis.pptxarsh260174
 
Regression Analysis Techniques.pptx
Regression Analysis Techniques.pptxRegression Analysis Techniques.pptx
Regression Analysis Techniques.pptxYutaItadori
 
Chapter 1: Linear Regression
Chapter 1: Linear RegressionChapter 1: Linear Regression
Chapter 1: Linear RegressionAkmelSyed
 
Unit-III Correlation and Regression.pptx
Unit-III Correlation and Regression.pptxUnit-III Correlation and Regression.pptx
Unit-III Correlation and Regression.pptxAnusuya123
 
regression-linearandlogisitics-220524024037-4221a176 (1).pdf
regression-linearandlogisitics-220524024037-4221a176 (1).pdfregression-linearandlogisitics-220524024037-4221a176 (1).pdf
regression-linearandlogisitics-220524024037-4221a176 (1).pdflisow86669
 

Similar to Simple Linear Regression: Step-By-Step (20)

Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Data Science - Part XII - Ridge Regression, LASSO, and Elastic NetsData Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
 
Line of best fit lesson
Line of best fit lessonLine of best fit lesson
Line of best fit lesson
 
5163147.ppt
5163147.ppt5163147.ppt
5163147.ppt
 
Ordinary Least Squares Ordinary Least Squares
Ordinary Least Squares Ordinary Least SquaresOrdinary Least Squares Ordinary Least Squares
Ordinary Least Squares Ordinary Least Squares
 
Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...
Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...
Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...
 
Bootcamp of new world to taken seriously
Bootcamp of new world to taken seriouslyBootcamp of new world to taken seriously
Bootcamp of new world to taken seriously
 
regression
regressionregression
regression
 
Grade 9 U0-L5-Graphing
Grade 9 U0-L5-GraphingGrade 9 U0-L5-Graphing
Grade 9 U0-L5-Graphing
 
Regression Analysis.pptx
Regression Analysis.pptxRegression Analysis.pptx
Regression Analysis.pptx
 
REGRESSION METasdfghjklmjhgftrHODS1.pptx
REGRESSION METasdfghjklmjhgftrHODS1.pptxREGRESSION METasdfghjklmjhgftrHODS1.pptx
REGRESSION METasdfghjklmjhgftrHODS1.pptx
 
Regression.pptx
Regression.pptxRegression.pptx
Regression.pptx
 
Regression.pptx
Regression.pptxRegression.pptx
Regression.pptx
 
regression.pptx
regression.pptxregression.pptx
regression.pptx
 
Regression Analysis.pptx
Regression Analysis.pptxRegression Analysis.pptx
Regression Analysis.pptx
 
Regression Analysis Techniques.pptx
Regression Analysis Techniques.pptxRegression Analysis Techniques.pptx
Regression Analysis Techniques.pptx
 
Chapter 1: Linear Regression
Chapter 1: Linear RegressionChapter 1: Linear Regression
Chapter 1: Linear Regression
 
Unit-III Correlation and Regression.pptx
Unit-III Correlation and Regression.pptxUnit-III Correlation and Regression.pptx
Unit-III Correlation and Regression.pptx
 
MSE.pptx
MSE.pptxMSE.pptx
MSE.pptx
 
regression-linearandlogisitics-220524024037-4221a176 (1).pdf
regression-linearandlogisitics-220524024037-4221a176 (1).pdfregression-linearandlogisitics-220524024037-4221a176 (1).pdf
regression-linearandlogisitics-220524024037-4221a176 (1).pdf
 
Linear and Logistics Regression
Linear and Logistics RegressionLinear and Logistics Regression
Linear and Logistics Regression
 

More from Dan Wellisch

Measuring, Mismeasuring, and Remeasuring - Creating Meaningful Key Performanc...
Measuring, Mismeasuring, and Remeasuring - Creating Meaningful Key Performanc...Measuring, Mismeasuring, and Remeasuring - Creating Meaningful Key Performanc...
Measuring, Mismeasuring, and Remeasuring - Creating Meaningful Key Performanc...Dan Wellisch
 
The Role Of Community-Based Organizations in Achieving Population Health Goals
The Role Of Community-Based Organizations in Achieving Population Health GoalsThe Role Of Community-Based Organizations in Achieving Population Health Goals
The Role Of Community-Based Organizations in Achieving Population Health GoalsDan Wellisch
 
Health Industry Cybersecurity Best Practices
Health Industry Cybersecurity Best PracticesHealth Industry Cybersecurity Best Practices
Health Industry Cybersecurity Best PracticesDan Wellisch
 
Driving Data to Cut Healthcare Costs
Driving Data to Cut Healthcare CostsDriving Data to Cut Healthcare Costs
Driving Data to Cut Healthcare CostsDan Wellisch
 
US Healthcare Reform Landscape - Addendum to June 2018 Presentation to the Ch...
US Healthcare Reform Landscape - Addendum to June 2018 Presentation to the Ch...US Healthcare Reform Landscape - Addendum to June 2018 Presentation to the Ch...
US Healthcare Reform Landscape - Addendum to June 2018 Presentation to the Ch...Dan Wellisch
 
Payer Analytics In A Shifting Healthcare Landscape - June Presentation To Chi...
Payer Analytics In A Shifting Healthcare Landscape - June Presentation To Chi...Payer Analytics In A Shifting Healthcare Landscape - June Presentation To Chi...
Payer Analytics In A Shifting Healthcare Landscape - June Presentation To Chi...Dan Wellisch
 
Who Is A HIPAA Business Associate ?
Who Is A  HIPAA  Business  Associate ?Who Is A  HIPAA  Business  Associate ?
Who Is A HIPAA Business Associate ?Dan Wellisch
 
Chronic Care Management - Implemented By TimeDoc - May 2018
Chronic Care Management - Implemented By TimeDoc - May 2018Chronic Care Management - Implemented By TimeDoc - May 2018
Chronic Care Management - Implemented By TimeDoc - May 2018Dan Wellisch
 
Managing HIPAA Business Associate Relationships - April 24, 2018
Managing HIPAA Business Associate Relationships  -  April 24, 2018  Managing HIPAA Business Associate Relationships  -  April 24, 2018
Managing HIPAA Business Associate Relationships - April 24, 2018 Dan Wellisch
 
Using Models For Analytically-Driven Cultural Transformation
Using Models For Analytically-Driven Cultural TransformationUsing Models For Analytically-Driven Cultural Transformation
Using Models For Analytically-Driven Cultural TransformationDan Wellisch
 
Analyzing Breast Cancer Dataset with Azure Machine Learning Studio
Analyzing Breast Cancer Dataset with Azure Machine Learning StudioAnalyzing Breast Cancer Dataset with Azure Machine Learning Studio
Analyzing Breast Cancer Dataset with Azure Machine Learning StudioDan Wellisch
 
Helping Health Healthcare: Financial Decision Support
Helping Health Healthcare: Financial Decision SupportHelping Health Healthcare: Financial Decision Support
Helping Health Healthcare: Financial Decision SupportDan Wellisch
 
AWS Machine Learning Workshop
AWS Machine Learning WorkshopAWS Machine Learning Workshop
AWS Machine Learning WorkshopDan Wellisch
 
What Are The All Payer Claims Databases (SCPDs) And What Could Be Used For?
What Are The All Payer Claims Databases (SCPDs) And What Could Be Used For?What Are The All Payer Claims Databases (SCPDs) And What Could Be Used For?
What Are The All Payer Claims Databases (SCPDs) And What Could Be Used For?Dan Wellisch
 
HIPAA Panel Discussion
HIPAA Panel Discussion HIPAA Panel Discussion
HIPAA Panel Discussion Dan Wellisch
 
Using Predictive Analytics For Care Management And Coordination
Using Predictive Analytics For Care Management And CoordinationUsing Predictive Analytics For Care Management And Coordination
Using Predictive Analytics For Care Management And CoordinationDan Wellisch
 
Rcm (Revenue Cycle Management)
Rcm (Revenue Cycle Management)Rcm (Revenue Cycle Management)
Rcm (Revenue Cycle Management)Dan Wellisch
 
Driving to consumerism
Driving to consumerismDriving to consumerism
Driving to consumerismDan Wellisch
 
Using The Hadoop Ecosystem to Drive Healthcare Innovation
Using The Hadoop Ecosystem to Drive Healthcare InnovationUsing The Hadoop Ecosystem to Drive Healthcare Innovation
Using The Hadoop Ecosystem to Drive Healthcare InnovationDan Wellisch
 

More from Dan Wellisch (19)

Measuring, Mismeasuring, and Remeasuring - Creating Meaningful Key Performanc...
Measuring, Mismeasuring, and Remeasuring - Creating Meaningful Key Performanc...Measuring, Mismeasuring, and Remeasuring - Creating Meaningful Key Performanc...
Measuring, Mismeasuring, and Remeasuring - Creating Meaningful Key Performanc...
 
The Role Of Community-Based Organizations in Achieving Population Health Goals
The Role Of Community-Based Organizations in Achieving Population Health GoalsThe Role Of Community-Based Organizations in Achieving Population Health Goals
The Role Of Community-Based Organizations in Achieving Population Health Goals
 
Health Industry Cybersecurity Best Practices
Health Industry Cybersecurity Best PracticesHealth Industry Cybersecurity Best Practices
Health Industry Cybersecurity Best Practices
 
Driving Data to Cut Healthcare Costs
Driving Data to Cut Healthcare CostsDriving Data to Cut Healthcare Costs
Driving Data to Cut Healthcare Costs
 
US Healthcare Reform Landscape - Addendum to June 2018 Presentation to the Ch...
US Healthcare Reform Landscape - Addendum to June 2018 Presentation to the Ch...US Healthcare Reform Landscape - Addendum to June 2018 Presentation to the Ch...
US Healthcare Reform Landscape - Addendum to June 2018 Presentation to the Ch...
 
Payer Analytics In A Shifting Healthcare Landscape - June Presentation To Chi...
Payer Analytics In A Shifting Healthcare Landscape - June Presentation To Chi...Payer Analytics In A Shifting Healthcare Landscape - June Presentation To Chi...
Payer Analytics In A Shifting Healthcare Landscape - June Presentation To Chi...
 
Who Is A HIPAA Business Associate ?
Who Is A  HIPAA  Business  Associate ?Who Is A  HIPAA  Business  Associate ?
Who Is A HIPAA Business Associate ?
 
Chronic Care Management - Implemented By TimeDoc - May 2018
Chronic Care Management - Implemented By TimeDoc - May 2018Chronic Care Management - Implemented By TimeDoc - May 2018
Chronic Care Management - Implemented By TimeDoc - May 2018
 
Managing HIPAA Business Associate Relationships - April 24, 2018
Managing HIPAA Business Associate Relationships  -  April 24, 2018  Managing HIPAA Business Associate Relationships  -  April 24, 2018
Managing HIPAA Business Associate Relationships - April 24, 2018
 
Using Models For Analytically-Driven Cultural Transformation
Using Models For Analytically-Driven Cultural TransformationUsing Models For Analytically-Driven Cultural Transformation
Using Models For Analytically-Driven Cultural Transformation
 
Analyzing Breast Cancer Dataset with Azure Machine Learning Studio
Analyzing Breast Cancer Dataset with Azure Machine Learning StudioAnalyzing Breast Cancer Dataset with Azure Machine Learning Studio
Analyzing Breast Cancer Dataset with Azure Machine Learning Studio
 
Helping Health Healthcare: Financial Decision Support
Helping Health Healthcare: Financial Decision SupportHelping Health Healthcare: Financial Decision Support
Helping Health Healthcare: Financial Decision Support
 
AWS Machine Learning Workshop
AWS Machine Learning WorkshopAWS Machine Learning Workshop
AWS Machine Learning Workshop
 
What Are The All Payer Claims Databases (SCPDs) And What Could Be Used For?
What Are The All Payer Claims Databases (SCPDs) And What Could Be Used For?What Are The All Payer Claims Databases (SCPDs) And What Could Be Used For?
What Are The All Payer Claims Databases (SCPDs) And What Could Be Used For?
 
HIPAA Panel Discussion
HIPAA Panel Discussion HIPAA Panel Discussion
HIPAA Panel Discussion
 
Using Predictive Analytics For Care Management And Coordination
Using Predictive Analytics For Care Management And CoordinationUsing Predictive Analytics For Care Management And Coordination
Using Predictive Analytics For Care Management And Coordination
 
Rcm (Revenue Cycle Management)
Rcm (Revenue Cycle Management)Rcm (Revenue Cycle Management)
Rcm (Revenue Cycle Management)
 
Driving to consumerism
Driving to consumerismDriving to consumerism
Driving to consumerism
 
Using The Hadoop Ecosystem to Drive Healthcare Innovation
Using The Hadoop Ecosystem to Drive Healthcare InnovationUsing The Hadoop Ecosystem to Drive Healthcare Innovation
Using The Hadoop Ecosystem to Drive Healthcare Innovation
 

Recently uploaded

Leading transformational change: inner and outer skills
Leading transformational change: inner and outer skillsLeading transformational change: inner and outer skills
Leading transformational change: inner and outer skillsHelenBevan4
 
Call Girl Gurgaon Saloni 9711199012 Independent Escort Service Gurgaon
Call Girl Gurgaon Saloni 9711199012 Independent Escort Service GurgaonCall Girl Gurgaon Saloni 9711199012 Independent Escort Service Gurgaon
Call Girl Gurgaon Saloni 9711199012 Independent Escort Service GurgaonCall Girls Service Gurgaon
 
Russian Call Girls in Chandigarh Ojaswi ❤️🍑 9907093804 👄🫦 Independent Escort ...
Russian Call Girls in Chandigarh Ojaswi ❤️🍑 9907093804 👄🫦 Independent Escort ...Russian Call Girls in Chandigarh Ojaswi ❤️🍑 9907093804 👄🫦 Independent Escort ...
Russian Call Girls in Chandigarh Ojaswi ❤️🍑 9907093804 👄🫦 Independent Escort ...High Profile Call Girls Chandigarh Aarushi
 
Basics of Anatomy- Language of Anatomy.pptx
Basics of Anatomy- Language of Anatomy.pptxBasics of Anatomy- Language of Anatomy.pptx
Basics of Anatomy- Language of Anatomy.pptxAyush Gupta
 
Bangalore call girl 👯‍♀️@ Simran Independent Call Girls in Bangalore GIUXUZ...
Bangalore call girl  👯‍♀️@ Simran Independent Call Girls in Bangalore  GIUXUZ...Bangalore call girl  👯‍♀️@ Simran Independent Call Girls in Bangalore  GIUXUZ...
Bangalore call girl 👯‍♀️@ Simran Independent Call Girls in Bangalore GIUXUZ...Gfnyt
 
VIP Call Girls Noida Jhanvi 9711199171 Best VIP Call Girls Near Me
VIP Call Girls Noida Jhanvi 9711199171 Best VIP Call Girls Near MeVIP Call Girls Noida Jhanvi 9711199171 Best VIP Call Girls Near Me
VIP Call Girls Noida Jhanvi 9711199171 Best VIP Call Girls Near Memriyagarg453
 
Dehradun Call Girls Service ❤️🍑 8854095900 👄🫦Independent Escort Service Dehradun
Dehradun Call Girls Service ❤️🍑 8854095900 👄🫦Independent Escort Service DehradunDehradun Call Girls Service ❤️🍑 8854095900 👄🫦Independent Escort Service Dehradun
Dehradun Call Girls Service ❤️🍑 8854095900 👄🫦Independent Escort Service DehradunNiamh verma
 
(Sonam Bajaj) Call Girl in Jaipur- 09257276172 Escorts Service 50% Off with C...
(Sonam Bajaj) Call Girl in Jaipur- 09257276172 Escorts Service 50% Off with C...(Sonam Bajaj) Call Girl in Jaipur- 09257276172 Escorts Service 50% Off with C...
(Sonam Bajaj) Call Girl in Jaipur- 09257276172 Escorts Service 50% Off with C...indiancallgirl4rent
 
VIP Call Girls Sector 67 Gurgaon Just Call Me 9711199012
VIP Call Girls Sector 67 Gurgaon Just Call Me 9711199012VIP Call Girls Sector 67 Gurgaon Just Call Me 9711199012
VIP Call Girls Sector 67 Gurgaon Just Call Me 9711199012Call Girls Service Gurgaon
 
💚😋Kolkata Escort Service Call Girls, ₹5000 To 25K With AC💚😋
💚😋Kolkata Escort Service Call Girls, ₹5000 To 25K With AC💚😋💚😋Kolkata Escort Service Call Girls, ₹5000 To 25K With AC💚😋
💚😋Kolkata Escort Service Call Girls, ₹5000 To 25K With AC💚😋Sheetaleventcompany
 
VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591
VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591
VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591adityaroy0215
 
Call Girl In Zirakpur ❤️♀️@ 9988299661 Zirakpur Call Girls Near Me ❤️♀️@ Sexy...
Call Girl In Zirakpur ❤️♀️@ 9988299661 Zirakpur Call Girls Near Me ❤️♀️@ Sexy...Call Girl In Zirakpur ❤️♀️@ 9988299661 Zirakpur Call Girls Near Me ❤️♀️@ Sexy...
Call Girl In Zirakpur ❤️♀️@ 9988299661 Zirakpur Call Girls Near Me ❤️♀️@ Sexy...Sheetaleventcompany
 
Russian Call Girls Kota * 8250192130 Service starts from just ₹9999 ✅
Russian Call Girls Kota * 8250192130 Service starts from just ₹9999 ✅Russian Call Girls Kota * 8250192130 Service starts from just ₹9999 ✅
Russian Call Girls Kota * 8250192130 Service starts from just ₹9999 ✅gragmanisha42
 
Vip Kolkata Call Girls Cossipore 👉 8250192130 ❣️💯 Available With Room 24×7
Vip Kolkata Call Girls Cossipore 👉 8250192130 ❣️💯 Available With Room 24×7Vip Kolkata Call Girls Cossipore 👉 8250192130 ❣️💯 Available With Room 24×7
Vip Kolkata Call Girls Cossipore 👉 8250192130 ❣️💯 Available With Room 24×7Miss joya
 
Jalandhar Female Call Girls Contact Number 9053900678 💚Jalandhar Female Call...
Jalandhar  Female Call Girls Contact Number 9053900678 💚Jalandhar Female Call...Jalandhar  Female Call Girls Contact Number 9053900678 💚Jalandhar Female Call...
Jalandhar Female Call Girls Contact Number 9053900678 💚Jalandhar Female Call...Call Girls Service Chandigarh Ayushi
 
❤️♀️@ Jaipur Call Girl Agency ❤️♀️@ Manjeet Russian Call Girls Service in Jai...
❤️♀️@ Jaipur Call Girl Agency ❤️♀️@ Manjeet Russian Call Girls Service in Jai...❤️♀️@ Jaipur Call Girl Agency ❤️♀️@ Manjeet Russian Call Girls Service in Jai...
❤️♀️@ Jaipur Call Girl Agency ❤️♀️@ Manjeet Russian Call Girls Service in Jai...Gfnyt.com
 
Dehradun Call Girls Service 8854095900 Real Russian Girls Looking Models
Dehradun Call Girls Service 8854095900 Real Russian Girls Looking ModelsDehradun Call Girls Service 8854095900 Real Russian Girls Looking Models
Dehradun Call Girls Service 8854095900 Real Russian Girls Looking Modelsindiancallgirl4rent
 

Recently uploaded (20)

Leading transformational change: inner and outer skills
Leading transformational change: inner and outer skillsLeading transformational change: inner and outer skills
Leading transformational change: inner and outer skills
 
Call Girls in Lucknow Esha 🔝 8923113531 🔝 🎶 Independent Escort Service Lucknow
Call Girls in Lucknow Esha 🔝 8923113531  🔝 🎶 Independent Escort Service LucknowCall Girls in Lucknow Esha 🔝 8923113531  🔝 🎶 Independent Escort Service Lucknow
Call Girls in Lucknow Esha 🔝 8923113531 🔝 🎶 Independent Escort Service Lucknow
 
Call Girl Gurgaon Saloni 9711199012 Independent Escort Service Gurgaon
Call Girl Gurgaon Saloni 9711199012 Independent Escort Service GurgaonCall Girl Gurgaon Saloni 9711199012 Independent Escort Service Gurgaon
Call Girl Gurgaon Saloni 9711199012 Independent Escort Service Gurgaon
 
Russian Call Girls in Chandigarh Ojaswi ❤️🍑 9907093804 👄🫦 Independent Escort ...
Russian Call Girls in Chandigarh Ojaswi ❤️🍑 9907093804 👄🫦 Independent Escort ...Russian Call Girls in Chandigarh Ojaswi ❤️🍑 9907093804 👄🫦 Independent Escort ...
Russian Call Girls in Chandigarh Ojaswi ❤️🍑 9907093804 👄🫦 Independent Escort ...
 
Basics of Anatomy- Language of Anatomy.pptx
Basics of Anatomy- Language of Anatomy.pptxBasics of Anatomy- Language of Anatomy.pptx
Basics of Anatomy- Language of Anatomy.pptx
 
Bangalore call girl 👯‍♀️@ Simran Independent Call Girls in Bangalore GIUXUZ...
Bangalore call girl  👯‍♀️@ Simran Independent Call Girls in Bangalore  GIUXUZ...Bangalore call girl  👯‍♀️@ Simran Independent Call Girls in Bangalore  GIUXUZ...
Bangalore call girl 👯‍♀️@ Simran Independent Call Girls in Bangalore GIUXUZ...
 
VIP Call Girls Noida Jhanvi 9711199171 Best VIP Call Girls Near Me
VIP Call Girls Noida Jhanvi 9711199171 Best VIP Call Girls Near MeVIP Call Girls Noida Jhanvi 9711199171 Best VIP Call Girls Near Me
VIP Call Girls Noida Jhanvi 9711199171 Best VIP Call Girls Near Me
 
Dehradun Call Girls Service ❤️🍑 8854095900 👄🫦Independent Escort Service Dehradun
Dehradun Call Girls Service ❤️🍑 8854095900 👄🫦Independent Escort Service DehradunDehradun Call Girls Service ❤️🍑 8854095900 👄🫦Independent Escort Service Dehradun
Dehradun Call Girls Service ❤️🍑 8854095900 👄🫦Independent Escort Service Dehradun
 
(Sonam Bajaj) Call Girl in Jaipur- 09257276172 Escorts Service 50% Off with C...
(Sonam Bajaj) Call Girl in Jaipur- 09257276172 Escorts Service 50% Off with C...(Sonam Bajaj) Call Girl in Jaipur- 09257276172 Escorts Service 50% Off with C...
(Sonam Bajaj) Call Girl in Jaipur- 09257276172 Escorts Service 50% Off with C...
 
VIP Call Girls Sector 67 Gurgaon Just Call Me 9711199012
VIP Call Girls Sector 67 Gurgaon Just Call Me 9711199012VIP Call Girls Sector 67 Gurgaon Just Call Me 9711199012
VIP Call Girls Sector 67 Gurgaon Just Call Me 9711199012
 
Call Girl Guwahati Aashi 👉 7001305949 👈 🔝 Independent Escort Service Guwahati
Call Girl Guwahati Aashi 👉 7001305949 👈 🔝 Independent Escort Service GuwahatiCall Girl Guwahati Aashi 👉 7001305949 👈 🔝 Independent Escort Service Guwahati
Call Girl Guwahati Aashi 👉 7001305949 👈 🔝 Independent Escort Service Guwahati
 
💚😋Kolkata Escort Service Call Girls, ₹5000 To 25K With AC💚😋
💚😋Kolkata Escort Service Call Girls, ₹5000 To 25K With AC💚😋💚😋Kolkata Escort Service Call Girls, ₹5000 To 25K With AC💚😋
💚😋Kolkata Escort Service Call Girls, ₹5000 To 25K With AC💚😋
 
VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591
VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591
VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591
 
Call Girl In Zirakpur ❤️♀️@ 9988299661 Zirakpur Call Girls Near Me ❤️♀️@ Sexy...
Call Girl In Zirakpur ❤️♀️@ 9988299661 Zirakpur Call Girls Near Me ❤️♀️@ Sexy...Call Girl In Zirakpur ❤️♀️@ 9988299661 Zirakpur Call Girls Near Me ❤️♀️@ Sexy...
Call Girl In Zirakpur ❤️♀️@ 9988299661 Zirakpur Call Girls Near Me ❤️♀️@ Sexy...
 
Russian Call Girls Kota * 8250192130 Service starts from just ₹9999 ✅
Russian Call Girls Kota * 8250192130 Service starts from just ₹9999 ✅Russian Call Girls Kota * 8250192130 Service starts from just ₹9999 ✅
Russian Call Girls Kota * 8250192130 Service starts from just ₹9999 ✅
 
Vip Kolkata Call Girls Cossipore 👉 8250192130 ❣️💯 Available With Room 24×7
Vip Kolkata Call Girls Cossipore 👉 8250192130 ❣️💯 Available With Room 24×7Vip Kolkata Call Girls Cossipore 👉 8250192130 ❣️💯 Available With Room 24×7
Vip Kolkata Call Girls Cossipore 👉 8250192130 ❣️💯 Available With Room 24×7
 
Jalandhar Female Call Girls Contact Number 9053900678 💚Jalandhar Female Call...
Jalandhar  Female Call Girls Contact Number 9053900678 💚Jalandhar Female Call...Jalandhar  Female Call Girls Contact Number 9053900678 💚Jalandhar Female Call...
Jalandhar Female Call Girls Contact Number 9053900678 💚Jalandhar Female Call...
 
❤️♀️@ Jaipur Call Girl Agency ❤️♀️@ Manjeet Russian Call Girls Service in Jai...
❤️♀️@ Jaipur Call Girl Agency ❤️♀️@ Manjeet Russian Call Girls Service in Jai...❤️♀️@ Jaipur Call Girl Agency ❤️♀️@ Manjeet Russian Call Girls Service in Jai...
❤️♀️@ Jaipur Call Girl Agency ❤️♀️@ Manjeet Russian Call Girls Service in Jai...
 
Dehradun Call Girls Service 8854095900 Real Russian Girls Looking Models
Dehradun Call Girls Service 8854095900 Real Russian Girls Looking ModelsDehradun Call Girls Service 8854095900 Real Russian Girls Looking Models
Dehradun Call Girls Service 8854095900 Real Russian Girls Looking Models
 
#9711199012# African Student Escorts in Delhi 😘 Call Girls Delhi
#9711199012# African Student Escorts in Delhi 😘 Call Girls Delhi#9711199012# African Student Escorts in Delhi 😘 Call Girls Delhi
#9711199012# African Student Escorts in Delhi 😘 Call Girls Delhi
 

Simple Linear Regression: Step-By-Step

  • 1. Simple Linear Regression: Step-By-Step Dan Wellisch danwellisch@gmail.com Chicago Technology For Value-Based Healthcare Meetup https://www.meetup.com/Chicago-Technology-For-Value-Based-Healthcare- Meetup/ 9/26/2017 Acknowledgement: Most of the tables and graphs used for this presentation are those of Brandon Foltz. https://www.youtube.com/user/BCFoltz I highly recommend his material. He is very good at explanations of complex statistical methods.
  • 2. What is Simple Linear Regression? Simple Linear Regression is a method used to fit the best straight line between a set of data points. After a graph is properly scaled, the data points must “look” like they would fit a straight line, not a parabola, or any other shape. The line is used as a model in order to predict a variable y from another variable x. A regression line must involve 2 variables, the dependent and the independent variable. Finding the “best-fit” line is the goal of simple linear regression.
  • 3. Definitions: Input, Predictive, Or Independent Variable X – 3 names mean the same thing. This is the variable whose value that is believed to influence the value of another variable. This variable should not be dependent on another variable (by definition) Output, Response, Or Dependent Variable Y – 3 names mean the same thing. This is the variable whose value that is believed to be influenced by the value of another variable. It is by definition, dependent on another variable. Best-Fit Line – Represents our model. It is the line that “best fits” our data points. The line represents the best estimate of the y value for every given input of x. Sum Of Squares – An important calculation we will use to find the best-fit line.
  • 5. • Problem: A waiter wants to predict his next tip, but he forgot to record the bill amounts for previous tips. • Here is a graph of his tips. The tips is the only variable. Let’s call it the y variable. • Meal# is not a variable. It is simply used to identify a tip. y variable Can we come up with a model for this problem with only 1 variable?
  • 6. • The only option for our model is to use the mean of the Tips($) • Tips are on the y access. We would call the mean 𝒚 (y bar). • The mean for the tip amounts is 10. • The model for our problem is simply 𝒚 = 10. • 𝒚 = 10 is our best fit line (represented by bold black line). 𝒚 = 10
  • 7. • Now, let’s talk about goodness of fit. This will tell us how good our data points fit the line. • We need to calculate the residuals (errors) for each point. -5 +7 +1 -2 +4 -5 𝒚 = 10
  • 8. -5 +7 +1 -2 +4 -5 𝒚 = 10 • The best fit line is the one that minimizes the sum of the squares of the residuals (errors). • The error is the difference between the actual data point and the point on the line. • SSE (Sum Of Squared Errors) = (-5)2 + 72 + 12 + (-2)2 + 42 + (-5)2 = 120 • SST (Sum Of Squared Total) = SSR (Sum Of Squared Regression) + SSE is the Sum Of Squares Equation. • Since there is no regression line (as we only have 1 variable), we can not make the SSE any smaller than 120, because SSR = 0.
  • 10. The goal of simple linear regression is to create a linear model that minimizes the sum of squares of the errors (SSE). From a previous slide: SST (Sum Of Squared Total) = SSR (Sum Of Squared Regression) + SSE When we have 2 variables, we can create a regression line; and therefore, we can calculate an SSR > 0. If SSR > 0, then we can reduce SSE. Minimizing the errors means that the line will fit the data better. 2 variables: One is the dependent variable: y. The other is the independent variable x. Goal Of Simple Linear Regression
  • 11. So now, we need to introduce a little math….. Remember from the previous slide that we want to minimize the SSE. We write this mathematically this way.: 𝑦 is often referred to as y-hat.
  • 12. • Repeating the Problem: As a waiter, how do we predict the tips we will receive for service rendered? • Let’s say, we didn’t forget to record the bill amount. Independent Variable (x) Dependent Variable (y)
  • 13. If we scale the graph according to the data points available, we can then plot the points.
  • 14.
  • 15.
  • 16. Algebra Of Lines - Slope Equation Of A Straight Line Y = mX + b slope y-intercept m = (rise/run) = (yj – yi) / (xj – xi) b is the point where x = 0 and y intersects the y-axis y x xj, yj • (0,b) •xi, yi run rise
  • 17. Think of sy divided by sx as the variation (resembling change) in Y over the variation in X, in units of X and Y. Rise Over Run! Derivation to this Regression Line - Slope
  • 18. Let’s create a table of calculations that we can use to calculate the slope of the regression (best-fit) line.
  • 19.
  • 20. • Now that we have the slope, we can calculate the y-intercept because we know 1 point on the line already (74,10). • What do we call 74,10?
  • 21. • (74,10) is the Centroid. • For comparison, Excel has calculated the regression equation very close to our manual calculation. Excel calculation
  • 22. Meaning of our equation….
  • 23. SST = SSR + SSE
  • 24.
  • 25. Summary The regression line must have an SSE < the SSE of the one variable equation, where y = the mean of the data values. Otherwise, it is not a good model to predict y, given x. Remember the Sum Of Squares equation, SST = SSR + SSE. In our example, 120 is the SSE if we only had the past tips (no bill amounts) to predict our next tip. SSR is 0 as there is no regression line. When we add an independent variable (the bill amount), the tips becomes the dependent variable and we can create a regression line. The regression line contributes to the SST and therefore reduces the SSE from 120 to 30.075. Since 30.075 < 120, our regression line is a better model for predicting future tips.