SlideShare une entreprise Scribd logo
1  sur  15
Chapitre 3: Estimation des modèles de
régressions linéaires par les MCO
Armel NONVIDE, Ph.D
0- Rappels sur les MCO
Principe des MCO
𝑀𝑖𝑛 𝑒𝑖
2
= 𝑀𝑖𝑛 𝑌𝑖 − 𝛽0 − 𝛽1𝑋1
2
Hypothèses des MCO
H1: Linéarité du modèle dans les paramètres
H2: Absence d’errer de mesure des variables
H3: Absence d’erreur de spécification du modèle
0- Rappels sur les MCO
H5: Homoscédasticité de la variance 𝐸 𝜀𝑖
2 = 𝜎2
H6: Absence d’autocorrélation des erreurs 𝐸 𝜀𝑖, 𝜀𝑗 = 0 ∀ 𝑖 ≠ 𝑗
H7: Exogenéité des variables explicatives 𝐸 𝜀𝑖/𝑋𝑖 = 0
H9: Le terme d′erreur suit une loi normale de moyenne 0 et de
variance constante
H4: Espérance mathématique est nulle 𝐸 𝜀𝑖 = 0
H8: Absence de multicolinéarité entre les variables explicatives
1- Modèle de regression lineaire simple et multiple
reg yvar var1, option
La commande regresse permet d’estimer les modèles suivant les MCO
sous stata
yvar est la variable dependante
var1est la variable explicative
Pour les modèle lineaire simple, la commande est:
2- Modèle de regressions lineaires multiples
reg yvar var1 var2 var3, option
Pour les modèles de regression lineaires multiples, la commande est:
yvar est la variable dependante
var1 var2 et var3 sont les variables explicatives
Lorsque le model contient des variables alphanumeriques , il faut mettre i.
devant les noms des variables pour obtenir le coef de chaque modalités
reg yvar var1 var2 var3 i.var4, option
3- Quelques commandes après estimation
La commande predict est généralement utilisée pour faire des
predictions après estimation
predict var1 crée la variable var1 qui contient les valeures estimées
de la variables dépendante
predict var2, residuals crée la variable var2 qui contient les residus
modéles
4-Tests de Diagnostiques
4.1-Test d’heterosedasticité
Il y a deux methodes pour détecter l’heteroskedasticité apres estimation:
l’analyse graphique des residus et les tests statistiques
Pour l’analyse grahique, il faut creer un nuage de point en utilisant le
carré des résidus avec les valeures prédictes de la variable dépendante
twoway scatter resid2 yhat, yline(0)
predict yhat, xb
predict resid, residuals
gen resid2=resid*resid
les commandes rvpplot et rvfplot sont utlisées pour créer des
nuages de points après estimation
rvfplot, yline(0) crée un nuage de points des valeurs predictes de la
variable dépendante et des residus
4.1-Test d’heterosedasticité
rvpplot var, yline(0) crée un nuage de points des residus avec la variable
dépendante var
4.1-Test d’heteroskedasticité
Breusch-Pagan / Cook-Weisberg test
estat hettest
White heteroskedasticity test
estat imtest, white
Les tests de Breusch-Pagan and the White sont géneralement utilisés pour
analyser l’heteroskedasticité après estimation
4.1-Test d’heteroskedasticité
On peut corriger l’hetéroskedasticité en :
1-respécifiant le modèle: revoir la forme mathématique
2-faire une estimation robuste
reg yvar var1 var2 var3 i.var4, vce(ro)
reg yvar var1 var2 var3 i.var4, vce(hc3) pour des bases de donnés
de petite taille
3- faire une estimation par les MCO Pondéré
4.2-Test de multicolinéarité
Après estimation la commande estat vif permet de detecter la presence de
multicolinéarité entre les variables explicatives
Une variable est source de multicollinéarité si son VIF>10
Il y a multicolinéarité dans le modèle si mean VIF >1
4.3-Test d’omission de variables pertinentes
Le test de Ramsey, encore appellé test de spécification permet de
savoir s’il y a omission de variables pertinentes
La commande du test est:
estat ovtest
4.3-Test de normalité des erreurs
sktest resid test de normalité de Skweness et Kurtosis
Après avoir prédi les residus (resid) du model on peut utiliser
swilk resid test de normalité de Shapiro-wilk
5- Analyse des effets marginaux
La commande margins permet de predire les effects marginaux
apres estimation
Margins varlist, option
Option
dydx effets marginaux
eyex élasticité
dYeX semi-élasticité
Eydx semi-élasticité
6- Interpretation des Résultats d’estimation
_cons 1.555527 .607123 2.56 0.020 .2746092 2.836444
educ -.0435396 .1080905 -0.40 0.692 -.2715907 .1845116
se -.0676497 .3060623 -0.22 0.828 -.7133847 .5780854
age -.0003806 .0158439 -0.02 0.981 -.0338083 .0330471
superf Coef. Std. Err. t P>|t| [95% Conf. Interval]
Total 7.62252381 20 .38112619 Root MSE = .6643
Adj R-squared = -0.1579
Residual 7.5020456 17 .4412968 R-squared = 0.0158
Model .120478211 3 .040159404 Prob > F = 0.9640
F(3, 17) = 0.09
Source SS df MS Number of obs = 21
Cas pratique de la regression suivante:

Contenu connexe

En vedette

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

En vedette (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

Estimation par les MCO sur le logiciel STATA

  • 1. Chapitre 3: Estimation des modèles de régressions linéaires par les MCO Armel NONVIDE, Ph.D
  • 2. 0- Rappels sur les MCO Principe des MCO 𝑀𝑖𝑛 𝑒𝑖 2 = 𝑀𝑖𝑛 𝑌𝑖 − 𝛽0 − 𝛽1𝑋1 2 Hypothèses des MCO H1: Linéarité du modèle dans les paramètres H2: Absence d’errer de mesure des variables H3: Absence d’erreur de spécification du modèle
  • 3. 0- Rappels sur les MCO H5: Homoscédasticité de la variance 𝐸 𝜀𝑖 2 = 𝜎2 H6: Absence d’autocorrélation des erreurs 𝐸 𝜀𝑖, 𝜀𝑗 = 0 ∀ 𝑖 ≠ 𝑗 H7: Exogenéité des variables explicatives 𝐸 𝜀𝑖/𝑋𝑖 = 0 H9: Le terme d′erreur suit une loi normale de moyenne 0 et de variance constante H4: Espérance mathématique est nulle 𝐸 𝜀𝑖 = 0 H8: Absence de multicolinéarité entre les variables explicatives
  • 4. 1- Modèle de regression lineaire simple et multiple reg yvar var1, option La commande regresse permet d’estimer les modèles suivant les MCO sous stata yvar est la variable dependante var1est la variable explicative Pour les modèle lineaire simple, la commande est:
  • 5. 2- Modèle de regressions lineaires multiples reg yvar var1 var2 var3, option Pour les modèles de regression lineaires multiples, la commande est: yvar est la variable dependante var1 var2 et var3 sont les variables explicatives Lorsque le model contient des variables alphanumeriques , il faut mettre i. devant les noms des variables pour obtenir le coef de chaque modalités reg yvar var1 var2 var3 i.var4, option
  • 6. 3- Quelques commandes après estimation La commande predict est généralement utilisée pour faire des predictions après estimation predict var1 crée la variable var1 qui contient les valeures estimées de la variables dépendante predict var2, residuals crée la variable var2 qui contient les residus modéles
  • 7. 4-Tests de Diagnostiques 4.1-Test d’heterosedasticité Il y a deux methodes pour détecter l’heteroskedasticité apres estimation: l’analyse graphique des residus et les tests statistiques Pour l’analyse grahique, il faut creer un nuage de point en utilisant le carré des résidus avec les valeures prédictes de la variable dépendante twoway scatter resid2 yhat, yline(0) predict yhat, xb predict resid, residuals gen resid2=resid*resid
  • 8. les commandes rvpplot et rvfplot sont utlisées pour créer des nuages de points après estimation rvfplot, yline(0) crée un nuage de points des valeurs predictes de la variable dépendante et des residus 4.1-Test d’heterosedasticité rvpplot var, yline(0) crée un nuage de points des residus avec la variable dépendante var
  • 9. 4.1-Test d’heteroskedasticité Breusch-Pagan / Cook-Weisberg test estat hettest White heteroskedasticity test estat imtest, white Les tests de Breusch-Pagan and the White sont géneralement utilisés pour analyser l’heteroskedasticité après estimation
  • 10. 4.1-Test d’heteroskedasticité On peut corriger l’hetéroskedasticité en : 1-respécifiant le modèle: revoir la forme mathématique 2-faire une estimation robuste reg yvar var1 var2 var3 i.var4, vce(ro) reg yvar var1 var2 var3 i.var4, vce(hc3) pour des bases de donnés de petite taille 3- faire une estimation par les MCO Pondéré
  • 11. 4.2-Test de multicolinéarité Après estimation la commande estat vif permet de detecter la presence de multicolinéarité entre les variables explicatives Une variable est source de multicollinéarité si son VIF>10 Il y a multicolinéarité dans le modèle si mean VIF >1
  • 12. 4.3-Test d’omission de variables pertinentes Le test de Ramsey, encore appellé test de spécification permet de savoir s’il y a omission de variables pertinentes La commande du test est: estat ovtest
  • 13. 4.3-Test de normalité des erreurs sktest resid test de normalité de Skweness et Kurtosis Après avoir prédi les residus (resid) du model on peut utiliser swilk resid test de normalité de Shapiro-wilk
  • 14. 5- Analyse des effets marginaux La commande margins permet de predire les effects marginaux apres estimation Margins varlist, option Option dydx effets marginaux eyex élasticité dYeX semi-élasticité Eydx semi-élasticité
  • 15. 6- Interpretation des Résultats d’estimation _cons 1.555527 .607123 2.56 0.020 .2746092 2.836444 educ -.0435396 .1080905 -0.40 0.692 -.2715907 .1845116 se -.0676497 .3060623 -0.22 0.828 -.7133847 .5780854 age -.0003806 .0158439 -0.02 0.981 -.0338083 .0330471 superf Coef. Std. Err. t P>|t| [95% Conf. Interval] Total 7.62252381 20 .38112619 Root MSE = .6643 Adj R-squared = -0.1579 Residual 7.5020456 17 .4412968 R-squared = 0.0158 Model .120478211 3 .040159404 Prob > F = 0.9640 F(3, 17) = 0.09 Source SS df MS Number of obs = 21 Cas pratique de la regression suivante: