SlideShare a Scribd company logo
Regression
A skin-deep dive (oxymoron intended)
by @abulyomon
Agenda
Simple Linear Regression
Exercise
Multiple Linear Regression
Exercise
Logistic Regression
Exercise
Where am I?
By now, you should be able to:
● Obtain and clean data.
● Conduct Exploratory Data Analysis as well as some visualization.
This session is your first step into explaining some cross-sectional
data.
Disclaimer
● This session does not teach Python.
● Although it is necessary to understand the math behind modeling,
we will not go through details. We will give recipes :(
Context & Terminology
Linear Regression
A regression model approximates the relation between the dependant
and independant variables:
Y = f(X1
, X2
, ..., Xi
) + ε
when Y is continuous quantitative and the relation is linearizable:
Y = β0
+ β1
X1
+ β2
X2
+ ... + βi
Xi
+ ε
Linearity
● Linear
Y = β0
+ β1
X + β2
X2
+ ε
Y = β0
+ β1
X1
+ β2
X2
+ ε
● Not linear
Y = β0
+
e
β1
X1
+ ε
Ordinary Least Squares Estimation
Notes on OLS
OLS Assumes:
1. Linearity
2. Random sampling
3. Error terms are normally distributed
4. Error terms have constant variance (homoskedasticity)
5. Error terms are independent (autocorrelation?)
There is another estimation method called Maximum Likelihood
Estimation. In the case of Linear Regression, MLE yields OLS findings!
Practice
File: AlWaseet.csv
Problem definition: What is the
relation between car mileage and
car price?
Model Interpretation + Inference
Coefficients
R2
: Predictive power based on
correlation
= Explained Variation/ Total
Variation
p-value: Statistical significance
10’
BREAK TIME
Multiple Linear Regression
Where is the nice graph?
Problem of collinearity
R2
: Curse of Dimensionality
Practice
File: AlWaseet.csv
Can we build a better model for
price with more predictors?
More inference + Model Comparison
Ra
2
: Adjusted
F-test: tests the null hypothesis that coefficients are zero!
AIC: Information Criteria
BIC: Information Criteria with severe penalty to (i)
Goodness-of-fit: Visual Checks
Normal probability plot of
residuals ->
Scatter plot of residuals vs
predictor variables
Scatter plot of residuals vs
fitted values
import statsmodels.graphics.gofplots as gof
import scipy.stats as stats
gof.qqplot(fitted_model.resid, stats.t, fit=True,
line='45')
plt.show()
###
plt.hist(fitted_model.resid_pearson)
plt.show()
Your HW, should you choose to accept it
Is the origin of the car significant in determining its price?
Are Korean made cars particularly different when it comes to price?
How do we handle categorical variables?
10’
BREAK TIME
Logistic Regression
We have expressed earlier that a regression model approximates the
relation between the dependant and independant variables:
Y = f(X1
, X2
, ..., Xi
) + ε
when Y is binary:
ln( /1- ) = β0
+ β1
X1
+ β2
X2
+ ... + βi
Xi
where = P(Y=1|X1
=x1
, ..., Xi
=xi
) and ( /1- ) is referred is
to as the “odds.”
Let’s demystify that cryptic slide!
Suppose Y, the dependant variable was “CHASSIS” which signifies if a
car was damaged, denoted by: “1” if damaged, and “0” if not. One way
to model this may be:
ln(o) = β0
+ β1
PRICE+ β2
MILEAGE + β3
AGE
The odds of a car of price p, mileage m, and age a being damaged
would be:
Practice
File: AlWaseet.csv
Can we guess the smashed car?
Predictive Accuracy
in-sample -> goodness-of-fit
Guard against overfitting
out-of-sample -> cross-validation
Next?
Further reading
● Regression Analysis by Example, Chatterjee & Hadi
● Logistic Regression using SAS, Allison
Contact me:
● @abulyomon
● abulyomon@gmail.com

More Related Content

What's hot

Functional Forms of Regression Models | Eonomics
Functional Forms of Regression Models | EonomicsFunctional Forms of Regression Models | Eonomics
Functional Forms of Regression Models | Eonomics
Transweb Global Inc
 
Simple linear regression analysis
Simple linear  regression analysisSimple linear  regression analysis
Simple linear regression analysisNorma Mingo
 
Econometrics chapter 5-two-variable-regression-interval-estimation-
Econometrics chapter 5-two-variable-regression-interval-estimation-Econometrics chapter 5-two-variable-regression-interval-estimation-
Econometrics chapter 5-two-variable-regression-interval-estimation-
Alamin Milton
 
Tbs910 regression models
Tbs910 regression modelsTbs910 regression models
Tbs910 regression models
Stephen Ong
 
Simple Regression
Simple RegressionSimple Regression
Simple Regression
Khawaja Naveed
 
Regression analysis by akanksha Bali
Regression analysis by akanksha BaliRegression analysis by akanksha Bali
Regression analysis by akanksha Bali
Akanksha Bali
 
Linear regression without tears
Linear regression without tearsLinear regression without tears
Linear regression without tears
Ankit Sharma
 
Linear regression
Linear regression Linear regression
Linear regression
Vani011
 
Simple linear regression and correlation
Simple linear regression and correlationSimple linear regression and correlation
Simple linear regression and correlation
Shakeel Nouman
 
Linear Regression and Logistic Regression in ML
Linear Regression and Logistic Regression in MLLinear Regression and Logistic Regression in ML
Linear Regression and Logistic Regression in ML
Kumud Arora
 
Regression analysis in excel
Regression analysis in excelRegression analysis in excel
Regression analysis in excel
Thilina Rathnayaka
 
Introduction to Regression Analysis and R
Introduction to Regression Analysis and R   Introduction to Regression Analysis and R
Introduction to Regression Analysis and R
Rachana Taneja Bhatia
 
Regression (Linear Regression and Logistic Regression) by Akanksha Bali
Regression (Linear Regression and Logistic Regression) by Akanksha BaliRegression (Linear Regression and Logistic Regression) by Akanksha Bali
Regression (Linear Regression and Logistic Regression) by Akanksha Bali
Akanksha Bali
 
Presentation on regression analysis
Presentation on regression analysisPresentation on regression analysis
Presentation on regression analysis
Sujeet Singh
 
Linear Regression Analysis | Linear Regression in Python | Machine Learning A...
Linear Regression Analysis | Linear Regression in Python | Machine Learning A...Linear Regression Analysis | Linear Regression in Python | Machine Learning A...
Linear Regression Analysis | Linear Regression in Python | Machine Learning A...
Simplilearn
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
sayantansarkar50
 
Regression analysis in R
Regression analysis in RRegression analysis in R
Regression analysis in R
Alichy Sowmya
 
Linear regression analysis
Linear regression analysisLinear regression analysis
Linear regression analysis
Nimrita Koul
 
Regression
Regression Regression
Regression
sayantansarkar50
 
Linear regression
Linear regressionLinear regression
Linear regression
Leonardo Auslender
 

What's hot (20)

Functional Forms of Regression Models | Eonomics
Functional Forms of Regression Models | EonomicsFunctional Forms of Regression Models | Eonomics
Functional Forms of Regression Models | Eonomics
 
Simple linear regression analysis
Simple linear  regression analysisSimple linear  regression analysis
Simple linear regression analysis
 
Econometrics chapter 5-two-variable-regression-interval-estimation-
Econometrics chapter 5-two-variable-regression-interval-estimation-Econometrics chapter 5-two-variable-regression-interval-estimation-
Econometrics chapter 5-two-variable-regression-interval-estimation-
 
Tbs910 regression models
Tbs910 regression modelsTbs910 regression models
Tbs910 regression models
 
Simple Regression
Simple RegressionSimple Regression
Simple Regression
 
Regression analysis by akanksha Bali
Regression analysis by akanksha BaliRegression analysis by akanksha Bali
Regression analysis by akanksha Bali
 
Linear regression without tears
Linear regression without tearsLinear regression without tears
Linear regression without tears
 
Linear regression
Linear regression Linear regression
Linear regression
 
Simple linear regression and correlation
Simple linear regression and correlationSimple linear regression and correlation
Simple linear regression and correlation
 
Linear Regression and Logistic Regression in ML
Linear Regression and Logistic Regression in MLLinear Regression and Logistic Regression in ML
Linear Regression and Logistic Regression in ML
 
Regression analysis in excel
Regression analysis in excelRegression analysis in excel
Regression analysis in excel
 
Introduction to Regression Analysis and R
Introduction to Regression Analysis and R   Introduction to Regression Analysis and R
Introduction to Regression Analysis and R
 
Regression (Linear Regression and Logistic Regression) by Akanksha Bali
Regression (Linear Regression and Logistic Regression) by Akanksha BaliRegression (Linear Regression and Logistic Regression) by Akanksha Bali
Regression (Linear Regression and Logistic Regression) by Akanksha Bali
 
Presentation on regression analysis
Presentation on regression analysisPresentation on regression analysis
Presentation on regression analysis
 
Linear Regression Analysis | Linear Regression in Python | Machine Learning A...
Linear Regression Analysis | Linear Regression in Python | Machine Learning A...Linear Regression Analysis | Linear Regression in Python | Machine Learning A...
Linear Regression Analysis | Linear Regression in Python | Machine Learning A...
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Regression analysis in R
Regression analysis in RRegression analysis in R
Regression analysis in R
 
Linear regression analysis
Linear regression analysisLinear regression analysis
Linear regression analysis
 
Regression
Regression Regression
Regression
 
Linear regression
Linear regressionLinear regression
Linear regression
 

Viewers also liked

Simple linear regression (final)
Simple linear regression (final)Simple linear regression (final)
Simple linear regression (final)Harsh Upadhyay
 
C2.1 intro
C2.1 introC2.1 intro
C2.1 intro
Daniel LIAO
 
Simple Linear Regression
Simple Linear RegressionSimple Linear Regression
Simple Linear RegressionSharlaine Ruth
 
Ch14
Ch14Ch14
Ch14
Evil Man
 
Simple linear regression
Simple linear regressionSimple linear regression
Simple linear regression
Maria Theresa
 
Simple Linear Regression (simplified)
Simple Linear Regression (simplified)Simple Linear Regression (simplified)
Simple Linear Regression (simplified)
Haoran Zhang
 
NG BB 36 Simple Linear Regression
NG BB 36 Simple Linear RegressionNG BB 36 Simple Linear Regression
NG BB 36 Simple Linear RegressionLeanleaders.org
 
Linear regression
Linear regressionLinear regression
Linear regression
vermaumeshverma
 
Simple Linier Regression
Simple Linier RegressionSimple Linier Regression
Simple Linier Regressiondessybudiyanti
 
Linear regression
Linear regressionLinear regression
Linear regressionTech_MX
 
Linear regression and correlation analysis ppt @ bec doms
Linear regression and correlation analysis ppt @ bec domsLinear regression and correlation analysis ppt @ bec doms
Linear regression and correlation analysis ppt @ bec doms
Babasab Patil
 
Lesson 8 Linear Correlation And Regression
Lesson 8 Linear Correlation And RegressionLesson 8 Linear Correlation And Regression
Lesson 8 Linear Correlation And RegressionSumit Prajapati
 
An Overview of Simple Linear Regression
An Overview of Simple Linear RegressionAn Overview of Simple Linear Regression
An Overview of Simple Linear Regression
Georgian Court University
 
Pearson Correlation, Spearman Correlation &Linear Regression
Pearson Correlation, Spearman Correlation &Linear RegressionPearson Correlation, Spearman Correlation &Linear Regression
Pearson Correlation, Spearman Correlation &Linear Regression
Azmi Mohd Tamil
 
Directing intelligence in_automotive_industry
Directing intelligence in_automotive_industryDirecting intelligence in_automotive_industry
Directing intelligence in_automotive_industry
Gregory Philippatos
 
C3.1.2
C3.1.2C3.1.2
C3.1.2
Daniel LIAO
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
Charles Punuhsingon
 
Optimization: A Framework for Predictive Analytics
Optimization: A Framework for Predictive AnalyticsOptimization: A Framework for Predictive Analytics
Optimization: A Framework for Predictive Analytics
NYC Predictive Analytics
 
NIPS2010: optimization algorithms in machine learning
NIPS2010: optimization algorithms in machine learningNIPS2010: optimization algorithms in machine learning
NIPS2010: optimization algorithms in machine learningzukun
 

Viewers also liked (20)

Simple linear regression (final)
Simple linear regression (final)Simple linear regression (final)
Simple linear regression (final)
 
C2.1 intro
C2.1 introC2.1 intro
C2.1 intro
 
Simple Linear Regression
Simple Linear RegressionSimple Linear Regression
Simple Linear Regression
 
Ch14
Ch14Ch14
Ch14
 
Simple linear regression
Simple linear regressionSimple linear regression
Simple linear regression
 
Chapter13
Chapter13Chapter13
Chapter13
 
Simple Linear Regression (simplified)
Simple Linear Regression (simplified)Simple Linear Regression (simplified)
Simple Linear Regression (simplified)
 
NG BB 36 Simple Linear Regression
NG BB 36 Simple Linear RegressionNG BB 36 Simple Linear Regression
NG BB 36 Simple Linear Regression
 
Linear regression
Linear regressionLinear regression
Linear regression
 
Simple Linier Regression
Simple Linier RegressionSimple Linier Regression
Simple Linier Regression
 
Linear regression
Linear regressionLinear regression
Linear regression
 
Linear regression and correlation analysis ppt @ bec doms
Linear regression and correlation analysis ppt @ bec domsLinear regression and correlation analysis ppt @ bec doms
Linear regression and correlation analysis ppt @ bec doms
 
Lesson 8 Linear Correlation And Regression
Lesson 8 Linear Correlation And RegressionLesson 8 Linear Correlation And Regression
Lesson 8 Linear Correlation And Regression
 
An Overview of Simple Linear Regression
An Overview of Simple Linear RegressionAn Overview of Simple Linear Regression
An Overview of Simple Linear Regression
 
Pearson Correlation, Spearman Correlation &Linear Regression
Pearson Correlation, Spearman Correlation &Linear RegressionPearson Correlation, Spearman Correlation &Linear Regression
Pearson Correlation, Spearman Correlation &Linear Regression
 
Directing intelligence in_automotive_industry
Directing intelligence in_automotive_industryDirecting intelligence in_automotive_industry
Directing intelligence in_automotive_industry
 
C3.1.2
C3.1.2C3.1.2
C3.1.2
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Optimization: A Framework for Predictive Analytics
Optimization: A Framework for Predictive AnalyticsOptimization: A Framework for Predictive Analytics
Optimization: A Framework for Predictive Analytics
 
NIPS2010: optimization algorithms in machine learning
NIPS2010: optimization algorithms in machine learningNIPS2010: optimization algorithms in machine learning
NIPS2010: optimization algorithms in machine learning
 

Similar to Regression: A skin-deep dive

Chapter5.pdf.pdf
Chapter5.pdf.pdfChapter5.pdf.pdf
Chapter5.pdf.pdf
ROBERTOENRIQUEGARCAA1
 
CSE357 fa21 (6) Linear Machine Learning11-11.pdf
CSE357 fa21 (6) Linear Machine Learning11-11.pdfCSE357 fa21 (6) Linear Machine Learning11-11.pdf
CSE357 fa21 (6) Linear Machine Learning11-11.pdf
NermeenKamel7
 
Machine learning pt.1: Artificial Neural Networks ® All Rights Reserved
Machine learning pt.1: Artificial Neural Networks ® All Rights ReservedMachine learning pt.1: Artificial Neural Networks ® All Rights Reserved
Machine learning pt.1: Artificial Neural Networks ® All Rights Reserved
Jonathan Mitchell
 
ML - Multiple Linear Regression
ML - Multiple Linear RegressionML - Multiple Linear Regression
ML - Multiple Linear Regression
Andrew Ferlitsch
 
Econ ch 6
Econ ch 6Econ ch 6
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Edureka!
 
Ch 6 Slides.doc/9929292929292919299292@:&:&:&9/92
Ch 6 Slides.doc/9929292929292919299292@:&:&:&9/92Ch 6 Slides.doc/9929292929292919299292@:&:&:&9/92
Ch 6 Slides.doc/9929292929292919299292@:&:&:&9/92
ohenebabismark508
 
3ml.pdf
3ml.pdf3ml.pdf
3ml.pdf
MianAdnan27
 
Big Data Analysis
Big Data AnalysisBig Data Analysis
Big Data Analysis
NBER
 
working with python
working with pythonworking with python
working with python
bhavesh lande
 
Machine Learning
Machine LearningMachine Learning
Machine Learning
Ashwin P N
 
"Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof...
"Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof..."Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof...
"Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof...
Paris Women in Machine Learning and Data Science
 
nber_slides.pdf
nber_slides.pdfnber_slides.pdf
nber_slides.pdf
ssuser05b736
 
机器学习Adaboost
机器学习Adaboost机器学习Adaboost
机器学习Adaboost
Shocky1
 
Lecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptxLecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptx
ajondaree
 
Logistic Modeling with Applications to Marketing and Credit Risk in the Autom...
Logistic Modeling with Applications to Marketing and Credit Risk in the Autom...Logistic Modeling with Applications to Marketing and Credit Risk in the Autom...
Logistic Modeling with Applications to Marketing and Credit Risk in the Autom...
Magnify Analytic Solutions
 
lecture15-regularization.pptx
lecture15-regularization.pptxlecture15-regularization.pptx
lecture15-regularization.pptx
sghorai
 
Session 4 .pdf
Session 4 .pdfSession 4 .pdf
Session 4 .pdf
ssuser8cda84
 
Econometria Jose Nieves
Econometria Jose NievesEconometria Jose Nieves
Econometria Jose Nievespaquitootd
 
Python + Tensorflow: how to earn money in the Stock Exchange with Deep Learni...
Python + Tensorflow: how to earn money in the Stock Exchange with Deep Learni...Python + Tensorflow: how to earn money in the Stock Exchange with Deep Learni...
Python + Tensorflow: how to earn money in the Stock Exchange with Deep Learni...
ETS Asset Management Factory
 

Similar to Regression: A skin-deep dive (20)

Chapter5.pdf.pdf
Chapter5.pdf.pdfChapter5.pdf.pdf
Chapter5.pdf.pdf
 
CSE357 fa21 (6) Linear Machine Learning11-11.pdf
CSE357 fa21 (6) Linear Machine Learning11-11.pdfCSE357 fa21 (6) Linear Machine Learning11-11.pdf
CSE357 fa21 (6) Linear Machine Learning11-11.pdf
 
Machine learning pt.1: Artificial Neural Networks ® All Rights Reserved
Machine learning pt.1: Artificial Neural Networks ® All Rights ReservedMachine learning pt.1: Artificial Neural Networks ® All Rights Reserved
Machine learning pt.1: Artificial Neural Networks ® All Rights Reserved
 
ML - Multiple Linear Regression
ML - Multiple Linear RegressionML - Multiple Linear Regression
ML - Multiple Linear Regression
 
Econ ch 6
Econ ch 6Econ ch 6
Econ ch 6
 
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
 
Ch 6 Slides.doc/9929292929292919299292@:&:&:&9/92
Ch 6 Slides.doc/9929292929292919299292@:&:&:&9/92Ch 6 Slides.doc/9929292929292919299292@:&:&:&9/92
Ch 6 Slides.doc/9929292929292919299292@:&:&:&9/92
 
3ml.pdf
3ml.pdf3ml.pdf
3ml.pdf
 
Big Data Analysis
Big Data AnalysisBig Data Analysis
Big Data Analysis
 
working with python
working with pythonworking with python
working with python
 
Machine Learning
Machine LearningMachine Learning
Machine Learning
 
"Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof...
"Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof..."Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof...
"Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof...
 
nber_slides.pdf
nber_slides.pdfnber_slides.pdf
nber_slides.pdf
 
机器学习Adaboost
机器学习Adaboost机器学习Adaboost
机器学习Adaboost
 
Lecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptxLecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptx
 
Logistic Modeling with Applications to Marketing and Credit Risk in the Autom...
Logistic Modeling with Applications to Marketing and Credit Risk in the Autom...Logistic Modeling with Applications to Marketing and Credit Risk in the Autom...
Logistic Modeling with Applications to Marketing and Credit Risk in the Autom...
 
lecture15-regularization.pptx
lecture15-regularization.pptxlecture15-regularization.pptx
lecture15-regularization.pptx
 
Session 4 .pdf
Session 4 .pdfSession 4 .pdf
Session 4 .pdf
 
Econometria Jose Nieves
Econometria Jose NievesEconometria Jose Nieves
Econometria Jose Nieves
 
Python + Tensorflow: how to earn money in the Stock Exchange with Deep Learni...
Python + Tensorflow: how to earn money in the Stock Exchange with Deep Learni...Python + Tensorflow: how to earn money in the Stock Exchange with Deep Learni...
Python + Tensorflow: how to earn money in the Stock Exchange with Deep Learni...
 

Recently uploaded

STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
sameer shah
 
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdfEnhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
GetInData
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
TravisMalana
 
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
mbawufebxi
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
slg6lamcq
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
ahzuo
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
balafet
 
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptxData_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
AnirbanRoy608946
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
rwarrenll
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
jerlynmaetalle
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
Subhajit Sahu
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
haila53
 
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTESAdjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Subhajit Sahu
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
manishkhaire30
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
roli9797
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
axoqas
 
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
oz8q3jxlp
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
u86oixdj
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Subhajit Sahu
 

Recently uploaded (20)

STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
 
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdfEnhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
 
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
 
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptxData_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
 
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTESAdjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
 
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
 

Regression: A skin-deep dive

  • 1. Regression A skin-deep dive (oxymoron intended) by @abulyomon
  • 2. Agenda Simple Linear Regression Exercise Multiple Linear Regression Exercise Logistic Regression Exercise
  • 3. Where am I? By now, you should be able to: ● Obtain and clean data. ● Conduct Exploratory Data Analysis as well as some visualization. This session is your first step into explaining some cross-sectional data.
  • 4. Disclaimer ● This session does not teach Python. ● Although it is necessary to understand the math behind modeling, we will not go through details. We will give recipes :(
  • 6. Linear Regression A regression model approximates the relation between the dependant and independant variables: Y = f(X1 , X2 , ..., Xi ) + ε when Y is continuous quantitative and the relation is linearizable: Y = β0 + β1 X1 + β2 X2 + ... + βi Xi + ε
  • 7. Linearity ● Linear Y = β0 + β1 X + β2 X2 + ε Y = β0 + β1 X1 + β2 X2 + ε ● Not linear Y = β0 + e β1 X1 + ε
  • 9. Notes on OLS OLS Assumes: 1. Linearity 2. Random sampling 3. Error terms are normally distributed 4. Error terms have constant variance (homoskedasticity) 5. Error terms are independent (autocorrelation?) There is another estimation method called Maximum Likelihood Estimation. In the case of Linear Regression, MLE yields OLS findings!
  • 10. Practice File: AlWaseet.csv Problem definition: What is the relation between car mileage and car price?
  • 11. Model Interpretation + Inference Coefficients R2 : Predictive power based on correlation = Explained Variation/ Total Variation p-value: Statistical significance
  • 13. Multiple Linear Regression Where is the nice graph? Problem of collinearity R2 : Curse of Dimensionality
  • 14. Practice File: AlWaseet.csv Can we build a better model for price with more predictors?
  • 15. More inference + Model Comparison Ra 2 : Adjusted F-test: tests the null hypothesis that coefficients are zero! AIC: Information Criteria BIC: Information Criteria with severe penalty to (i)
  • 16. Goodness-of-fit: Visual Checks Normal probability plot of residuals -> Scatter plot of residuals vs predictor variables Scatter plot of residuals vs fitted values import statsmodels.graphics.gofplots as gof import scipy.stats as stats gof.qqplot(fitted_model.resid, stats.t, fit=True, line='45') plt.show() ### plt.hist(fitted_model.resid_pearson) plt.show()
  • 17. Your HW, should you choose to accept it Is the origin of the car significant in determining its price? Are Korean made cars particularly different when it comes to price? How do we handle categorical variables?
  • 19. Logistic Regression We have expressed earlier that a regression model approximates the relation between the dependant and independant variables: Y = f(X1 , X2 , ..., Xi ) + ε when Y is binary: ln( /1- ) = β0 + β1 X1 + β2 X2 + ... + βi Xi where = P(Y=1|X1 =x1 , ..., Xi =xi ) and ( /1- ) is referred is to as the “odds.”
  • 20. Let’s demystify that cryptic slide! Suppose Y, the dependant variable was “CHASSIS” which signifies if a car was damaged, denoted by: “1” if damaged, and “0” if not. One way to model this may be: ln(o) = β0 + β1 PRICE+ β2 MILEAGE + β3 AGE The odds of a car of price p, mileage m, and age a being damaged would be:
  • 21. Practice File: AlWaseet.csv Can we guess the smashed car?
  • 22. Predictive Accuracy in-sample -> goodness-of-fit Guard against overfitting out-of-sample -> cross-validation
  • 23. Next? Further reading ● Regression Analysis by Example, Chatterjee & Hadi ● Logistic Regression using SAS, Allison Contact me: ● @abulyomon ● abulyomon@gmail.com