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 analysis.Regression analysis.
Regression analysis.sonia gupta
 
Regression Analysis
Regression AnalysisRegression Analysis
Regression AnalysisSalim Azad
 
Multiple linear regression
Multiple linear regressionMultiple linear regression
Multiple linear regressionJames Neill
 
Least Squares Regression Method | Edureka
Least Squares Regression Method | EdurekaLeast Squares Regression Method | Edureka
Least Squares Regression Method | EdurekaEdureka!
 
Regression analysis
Regression analysisRegression analysis
Regression analysissaba khan
 
Simple & Multiple Regression Analysis
Simple & Multiple Regression AnalysisSimple & Multiple Regression Analysis
Simple & Multiple Regression AnalysisShailendra Tomar
 
Regression analysis in R
Regression analysis in RRegression analysis in R
Regression analysis in RAlichy Sowmya
 
Multiple regression presentation
Multiple regression presentationMultiple regression presentation
Multiple regression presentationCarlo Magno
 
Simple linear regression (final)
Simple linear regression (final)Simple linear regression (final)
Simple linear regression (final)Harsh Upadhyay
 
ML - Multiple Linear Regression
ML - Multiple Linear RegressionML - Multiple Linear Regression
ML - Multiple Linear RegressionAndrew Ferlitsch
 
Chapter 2 part3-Least-Squares Regression
Chapter 2 part3-Least-Squares RegressionChapter 2 part3-Least-Squares Regression
Chapter 2 part3-Least-Squares Regressionnszakir
 

What's hot (20)

Regression analysis.
Regression analysis.Regression analysis.
Regression analysis.
 
Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysis
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
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
 
Least Squares Regression Method | Edureka
Least Squares Regression Method | EdurekaLeast Squares Regression Method | Edureka
Least Squares Regression Method | Edureka
 
Regression
RegressionRegression
Regression
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Regression
RegressionRegression
Regression
 
Simple & Multiple Regression Analysis
Simple & Multiple Regression AnalysisSimple & Multiple Regression Analysis
Simple & Multiple Regression Analysis
 
Regression analysis in R
Regression analysis in RRegression analysis in R
Regression analysis in R
 
Simple Regression
Simple RegressionSimple Regression
Simple Regression
 
Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysis
 
Multiple regression presentation
Multiple regression presentationMultiple regression presentation
Multiple regression presentation
 
Regression ppt
Regression pptRegression ppt
Regression ppt
 
Simple linear regression (final)
Simple linear regression (final)Simple linear regression (final)
Simple linear regression (final)
 
Regression
RegressionRegression
Regression
 
ML - Multiple Linear Regression
ML - Multiple Linear RegressionML - Multiple Linear Regression
ML - Multiple Linear Regression
 
Chapter 2 part3-Least-Squares Regression
Chapter 2 part3-Least-Squares RegressionChapter 2 part3-Least-Squares Regression
Chapter 2 part3-Least-Squares Regression
 

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

Call Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in Anantapur
Call Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in AnantapurCall Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in Anantapur
Call Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in Anantapurgragmanisha42
 
Premium Call Girls Bangalore {7304373326} ❤️VVIP POOJA Call Girls in Bangalor...
Premium Call Girls Bangalore {7304373326} ❤️VVIP POOJA Call Girls in Bangalor...Premium Call Girls Bangalore {7304373326} ❤️VVIP POOJA Call Girls in Bangalor...
Premium Call Girls Bangalore {7304373326} ❤️VVIP POOJA Call Girls in Bangalor...Sheetaleventcompany
 
Call Girls in Udaipur Girija Udaipur Call Girl ✔ VQRWTO ❤️ 100% offer with...
Call Girls in Udaipur  Girija  Udaipur Call Girl  ✔ VQRWTO ❤️ 100% offer with...Call Girls in Udaipur  Girija  Udaipur Call Girl  ✔ VQRWTO ❤️ 100% offer with...
Call Girls in Udaipur Girija Udaipur Call Girl ✔ VQRWTO ❤️ 100% offer with...mahaiklolahd
 
dhanbad Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
dhanbad Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetdhanbad Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
dhanbad Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
bhubaneswar Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
bhubaneswar Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetbhubaneswar Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
bhubaneswar 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
 
VIP Call Girls Noida Sia 9711199171 High Class Call Girl Near Me
VIP Call Girls Noida Sia 9711199171 High Class Call Girl Near MeVIP Call Girls Noida Sia 9711199171 High Class Call Girl Near Me
VIP Call Girls Noida Sia 9711199171 High Class Call Girl Near Memriyagarg453
 
neemuch Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
neemuch Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetneemuch Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
neemuch Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
Ernakulam Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Ernakulam Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetErnakulam Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Ernakulam Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Chandigarh
 
💚 Punjabi Call Girls In Chandigarh 💯Lucky 🔝8868886958🔝Call Girl In Chandigarh
💚 Punjabi Call Girls In Chandigarh 💯Lucky 🔝8868886958🔝Call Girl In Chandigarh💚 Punjabi Call Girls In Chandigarh 💯Lucky 🔝8868886958🔝Call Girl In Chandigarh
💚 Punjabi Call Girls In Chandigarh 💯Lucky 🔝8868886958🔝Call Girl In ChandigarhSheetaleventcompany
 
Thoothukudi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Thoothukudi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetThoothukudi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Thoothukudi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
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
 
Hubli Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Hubli Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetHubli Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Hubli 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
 
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
 
Call Girls Service In Goa 💋 9316020077💋 Goa Call Girls By Russian Call Girl...
Call Girls Service In Goa  💋 9316020077💋 Goa Call Girls  By Russian Call Girl...Call Girls Service In Goa  💋 9316020077💋 Goa Call Girls  By Russian Call Girl...
Call Girls Service In Goa 💋 9316020077💋 Goa Call Girls By Russian Call Girl...russian goa call girl and escorts service
 
Sambalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Sambalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetSambalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Sambalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
Independent Call Girls Hyderabad 💋 9352988975 💋 Genuine WhatsApp Number for R...
Independent Call Girls Hyderabad 💋 9352988975 💋 Genuine WhatsApp Number for R...Independent Call Girls Hyderabad 💋 9352988975 💋 Genuine WhatsApp Number for R...
Independent Call Girls Hyderabad 💋 9352988975 💋 Genuine WhatsApp Number for R...Ahmedabad Call Girls
 
Bhagalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Bhagalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetBhagalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Bhagalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
bhopal Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
bhopal Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetbhopal Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
bhopal Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 

Recently uploaded (20)

Call Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in Anantapur
Call Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in AnantapurCall Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in Anantapur
Call Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in Anantapur
 
Premium Call Girls Bangalore {7304373326} ❤️VVIP POOJA Call Girls in Bangalor...
Premium Call Girls Bangalore {7304373326} ❤️VVIP POOJA Call Girls in Bangalor...Premium Call Girls Bangalore {7304373326} ❤️VVIP POOJA Call Girls in Bangalor...
Premium Call Girls Bangalore {7304373326} ❤️VVIP POOJA Call Girls in Bangalor...
 
Call Girls in Udaipur Girija Udaipur Call Girl ✔ VQRWTO ❤️ 100% offer with...
Call Girls in Udaipur  Girija  Udaipur Call Girl  ✔ VQRWTO ❤️ 100% offer with...Call Girls in Udaipur  Girija  Udaipur Call Girl  ✔ VQRWTO ❤️ 100% offer with...
Call Girls in Udaipur Girija Udaipur Call Girl ✔ VQRWTO ❤️ 100% offer with...
 
dhanbad Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
dhanbad Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetdhanbad Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
dhanbad Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
bhubaneswar Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
bhubaneswar Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetbhubaneswar Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
bhubaneswar 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
 
VIP Call Girls Noida Sia 9711199171 High Class Call Girl Near Me
VIP Call Girls Noida Sia 9711199171 High Class Call Girl Near MeVIP Call Girls Noida Sia 9711199171 High Class Call Girl Near Me
VIP Call Girls Noida Sia 9711199171 High Class Call Girl Near Me
 
neemuch Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
neemuch Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetneemuch Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
neemuch Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
Ernakulam Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Ernakulam Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetErnakulam Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Ernakulam Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
💚 Punjabi Call Girls In Chandigarh 💯Lucky 🔝8868886958🔝Call Girl In Chandigarh
💚 Punjabi Call Girls In Chandigarh 💯Lucky 🔝8868886958🔝Call Girl In Chandigarh💚 Punjabi Call Girls In Chandigarh 💯Lucky 🔝8868886958🔝Call Girl In Chandigarh
💚 Punjabi Call Girls In Chandigarh 💯Lucky 🔝8868886958🔝Call Girl In Chandigarh
 
Thoothukudi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Thoothukudi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetThoothukudi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Thoothukudi Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
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
 
Hubli Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Hubli Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetHubli Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Hubli 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
 
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
 
Call Girls Service In Goa 💋 9316020077💋 Goa Call Girls By Russian Call Girl...
Call Girls Service In Goa  💋 9316020077💋 Goa Call Girls  By Russian Call Girl...Call Girls Service In Goa  💋 9316020077💋 Goa Call Girls  By Russian Call Girl...
Call Girls Service In Goa 💋 9316020077💋 Goa Call Girls By Russian Call Girl...
 
Sambalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Sambalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetSambalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Sambalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
Independent Call Girls Hyderabad 💋 9352988975 💋 Genuine WhatsApp Number for R...
Independent Call Girls Hyderabad 💋 9352988975 💋 Genuine WhatsApp Number for R...Independent Call Girls Hyderabad 💋 9352988975 💋 Genuine WhatsApp Number for R...
Independent Call Girls Hyderabad 💋 9352988975 💋 Genuine WhatsApp Number for R...
 
Bhagalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Bhagalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetBhagalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Bhagalpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
bhopal Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
bhopal Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetbhopal Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
bhopal Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 

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.