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

Regression analysis
Regression analysisRegression analysis
Regression analysisRavi shankar
 
Central limit theorem
Central limit theoremCentral limit theorem
Central limit theoremVijeesh Soman
 
Regression analysis
Regression analysisRegression analysis
Regression analysisSrikant001p
 
Linear regression
Linear regressionLinear regression
Linear regressionTech_MX
 
Confidence Intervals: Basic concepts and overview
Confidence Intervals: Basic concepts and overviewConfidence Intervals: Basic concepts and overview
Confidence Intervals: Basic concepts and overviewRizwan S A
 
Simple & Multiple Regression Analysis
Simple & Multiple Regression AnalysisSimple & Multiple Regression Analysis
Simple & Multiple Regression AnalysisShailendra Tomar
 
multiple regression
multiple regressionmultiple regression
multiple regressionPriya Sharma
 
Linear regression
Linear regressionLinear regression
Linear regressionSreerajVA
 
Regression analysis
Regression analysisRegression analysis
Regression analysisSohag Babu
 
Presentation On Regression
Presentation On RegressionPresentation On Regression
Presentation On Regressionalok tiwari
 
Multiple linear regression
Multiple linear regressionMultiple linear regression
Multiple linear regressionJames Neill
 
Regression analysis in R
Regression analysis in RRegression analysis in R
Regression analysis in RAlichy Sowmya
 
Basics of Regression analysis
 Basics of Regression analysis Basics of Regression analysis
Basics of Regression analysisMahak Vijayvargiya
 
Regression
Regression Regression
Regression Ali Raza
 
Chapter8
Chapter8Chapter8
Chapter8Vu Vo
 
Generalized linear model
Generalized linear modelGeneralized linear model
Generalized linear modelRahul Rockers
 

What's hot (20)

Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Linear regression theory
Linear regression theoryLinear regression theory
Linear regression theory
 
Multiple linear regression
Multiple linear regressionMultiple linear regression
Multiple linear regression
 
Central limit theorem
Central limit theoremCentral limit theorem
Central limit theorem
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Linear regression
Linear regressionLinear regression
Linear regression
 
Confidence Intervals: Basic concepts and overview
Confidence Intervals: Basic concepts and overviewConfidence Intervals: Basic concepts and overview
Confidence Intervals: Basic concepts and overview
 
Simple & Multiple Regression Analysis
Simple & Multiple Regression AnalysisSimple & Multiple Regression Analysis
Simple & Multiple Regression Analysis
 
multiple regression
multiple regressionmultiple regression
multiple regression
 
Linear regression
Linear regressionLinear regression
Linear regression
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Presentation On Regression
Presentation On RegressionPresentation On Regression
Presentation On Regression
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Multiple linear regression
Multiple linear regressionMultiple linear regression
Multiple linear regression
 
Regression analysis in R
Regression analysis in RRegression analysis in R
Regression analysis in R
 
Basics of Regression analysis
 Basics of Regression analysis Basics of Regression analysis
Basics of Regression analysis
 
Regression
Regression Regression
Regression
 
Regression
RegressionRegression
Regression
 
Chapter8
Chapter8Chapter8
Chapter8
 
Generalized linear model
Generalized linear modelGeneralized linear model
Generalized linear model
 

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

Kolkata Call Girls Miss Inaaya ❤️ at @30% discount Everyday Call girl
Kolkata Call Girls Miss Inaaya ❤️ at @30% discount Everyday Call girlKolkata Call Girls Miss Inaaya ❤️ at @30% discount Everyday Call girl
Kolkata Call Girls Miss Inaaya ❤️ at @30% discount Everyday Call girlonly4webmaster01
 
Thrissur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Thrissur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetThrissur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Thrissur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
Escorts Service Ahmedabad🌹6367187148 🌹 No Need For Advance Payments
Escorts Service Ahmedabad🌹6367187148 🌹 No Need For Advance PaymentsEscorts Service Ahmedabad🌹6367187148 🌹 No Need For Advance Payments
Escorts Service Ahmedabad🌹6367187148 🌹 No Need For Advance PaymentsAhmedabad Call Girls
 
kochi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
kochi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetkochi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
kochi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
Jaipur Call Girls 9257276172 Call Girl in Jaipur Rajasthan
Jaipur Call Girls 9257276172 Call Girl in Jaipur RajasthanJaipur Call Girls 9257276172 Call Girl in Jaipur Rajasthan
Jaipur Call Girls 9257276172 Call Girl in Jaipur Rajasthanindiancallgirl4rent
 
Jalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Jalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetJalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Jalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
Kochi call girls Mallu escort girls available 7877702510
Kochi call girls Mallu escort girls available 7877702510Kochi call girls Mallu escort girls available 7877702510
Kochi call girls Mallu escort girls available 7877702510Vipesco
 
Sexy Call Girl Dharmapuri Arshi 💚9058824046💚 Dharmapuri Escort Service
Sexy Call Girl Dharmapuri Arshi 💚9058824046💚 Dharmapuri Escort ServiceSexy Call Girl Dharmapuri Arshi 💚9058824046💚 Dharmapuri Escort Service
Sexy Call Girl Dharmapuri Arshi 💚9058824046💚 Dharmapuri Escort Servicejaanseema653
 
Bareilly Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Bareilly Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetBareilly Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Bareilly Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
Dehradun Call Girls 8854095900 Call Girl in Dehradun Uttrakhand
Dehradun Call Girls 8854095900 Call Girl in Dehradun  UttrakhandDehradun Call Girls 8854095900 Call Girl in Dehradun  Uttrakhand
Dehradun Call Girls 8854095900 Call Girl in Dehradun Uttrakhandindiancallgirl4rent
 
ooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
ooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
ooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
Rajkot Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Rajkot Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetRajkot Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Rajkot Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
Top 20 Famous Indian Female Pornstars Name List 2024
Top 20 Famous Indian Female Pornstars Name List 2024Top 20 Famous Indian Female Pornstars Name List 2024
Top 20 Famous Indian Female Pornstars Name List 2024Sheetaleventcompany
 
nagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
nagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetnagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
nagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
Bihar Sharif Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Bihar Sharif Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetBihar Sharif Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Bihar Sharif Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
Call Girls Service Mohali {7435815124} ❤️VVIP PALAK Call Girl in Mohali Punjab
Call Girls Service Mohali {7435815124} ❤️VVIP PALAK Call Girl in Mohali PunjabCall Girls Service Mohali {7435815124} ❤️VVIP PALAK Call Girl in Mohali Punjab
Call Girls Service Mohali {7435815124} ❤️VVIP PALAK Call Girl in Mohali PunjabSheetaleventcompany
 
(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...
(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...
(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...Ahmedabad Call Girls
 
Vip Call Girls Makarba 👙 6367187148 👙 Genuine WhatsApp Number for Real Meet
Vip Call Girls Makarba 👙 6367187148 👙 Genuine WhatsApp Number for Real MeetVip Call Girls Makarba 👙 6367187148 👙 Genuine WhatsApp Number for Real Meet
Vip Call Girls Makarba 👙 6367187148 👙 Genuine WhatsApp Number for Real MeetAhmedabad Call Girls
 
Gorgeous Call Girls Mohali {7435815124} ❤️VVIP ANGEL Call Girls in Mohali Punjab
Gorgeous Call Girls Mohali {7435815124} ❤️VVIP ANGEL Call Girls in Mohali PunjabGorgeous Call Girls Mohali {7435815124} ❤️VVIP ANGEL Call Girls in Mohali Punjab
Gorgeous Call Girls Mohali {7435815124} ❤️VVIP ANGEL Call Girls in Mohali PunjabSheetaleventcompany
 

Recently uploaded (20)

Kolkata Call Girls Miss Inaaya ❤️ at @30% discount Everyday Call girl
Kolkata Call Girls Miss Inaaya ❤️ at @30% discount Everyday Call girlKolkata Call Girls Miss Inaaya ❤️ at @30% discount Everyday Call girl
Kolkata Call Girls Miss Inaaya ❤️ at @30% discount Everyday Call girl
 
Thrissur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Thrissur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetThrissur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Thrissur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
Escorts Service Ahmedabad🌹6367187148 🌹 No Need For Advance Payments
Escorts Service Ahmedabad🌹6367187148 🌹 No Need For Advance PaymentsEscorts Service Ahmedabad🌹6367187148 🌹 No Need For Advance Payments
Escorts Service Ahmedabad🌹6367187148 🌹 No Need For Advance Payments
 
kochi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
kochi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetkochi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
kochi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
Jaipur Call Girls 9257276172 Call Girl in Jaipur Rajasthan
Jaipur Call Girls 9257276172 Call Girl in Jaipur RajasthanJaipur Call Girls 9257276172 Call Girl in Jaipur Rajasthan
Jaipur Call Girls 9257276172 Call Girl in Jaipur Rajasthan
 
Jalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Jalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetJalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Jalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
Kochi call girls Mallu escort girls available 7877702510
Kochi call girls Mallu escort girls available 7877702510Kochi call girls Mallu escort girls available 7877702510
Kochi call girls Mallu escort girls available 7877702510
 
Sexy Call Girl Dharmapuri Arshi 💚9058824046💚 Dharmapuri Escort Service
Sexy Call Girl Dharmapuri Arshi 💚9058824046💚 Dharmapuri Escort ServiceSexy Call Girl Dharmapuri Arshi 💚9058824046💚 Dharmapuri Escort Service
Sexy Call Girl Dharmapuri Arshi 💚9058824046💚 Dharmapuri Escort Service
 
Bareilly Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Bareilly Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetBareilly Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Bareilly Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
Dehradun Call Girls 8854095900 Call Girl in Dehradun Uttrakhand
Dehradun Call Girls 8854095900 Call Girl in Dehradun  UttrakhandDehradun Call Girls 8854095900 Call Girl in Dehradun  Uttrakhand
Dehradun Call Girls 8854095900 Call Girl in Dehradun Uttrakhand
 
ooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
ooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
ooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
Rajkot Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Rajkot Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetRajkot Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Rajkot Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
Top 20 Famous Indian Female Pornstars Name List 2024
Top 20 Famous Indian Female Pornstars Name List 2024Top 20 Famous Indian Female Pornstars Name List 2024
Top 20 Famous Indian Female Pornstars Name List 2024
 
Punjab Call Girls Contact Number +919053,900,678 Punjab Call Girls
Punjab Call Girls Contact Number +919053,900,678 Punjab Call GirlsPunjab Call Girls Contact Number +919053,900,678 Punjab Call Girls
Punjab Call Girls Contact Number +919053,900,678 Punjab Call Girls
 
nagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
nagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetnagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
nagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
Bihar Sharif Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Bihar Sharif Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetBihar Sharif Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Bihar Sharif Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
Call Girls Service Mohali {7435815124} ❤️VVIP PALAK Call Girl in Mohali Punjab
Call Girls Service Mohali {7435815124} ❤️VVIP PALAK Call Girl in Mohali PunjabCall Girls Service Mohali {7435815124} ❤️VVIP PALAK Call Girl in Mohali Punjab
Call Girls Service Mohali {7435815124} ❤️VVIP PALAK Call Girl in Mohali Punjab
 
(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...
(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...
(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...
 
Vip Call Girls Makarba 👙 6367187148 👙 Genuine WhatsApp Number for Real Meet
Vip Call Girls Makarba 👙 6367187148 👙 Genuine WhatsApp Number for Real MeetVip Call Girls Makarba 👙 6367187148 👙 Genuine WhatsApp Number for Real Meet
Vip Call Girls Makarba 👙 6367187148 👙 Genuine WhatsApp Number for Real Meet
 
Gorgeous Call Girls Mohali {7435815124} ❤️VVIP ANGEL Call Girls in Mohali Punjab
Gorgeous Call Girls Mohali {7435815124} ❤️VVIP ANGEL Call Girls in Mohali PunjabGorgeous Call Girls Mohali {7435815124} ❤️VVIP ANGEL Call Girls in Mohali Punjab
Gorgeous Call Girls Mohali {7435815124} ❤️VVIP ANGEL Call Girls in Mohali Punjab
 

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.