You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/course/modelisation/3_regression/index.qmd
+15-12Lines changed: 15 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -223,10 +223,10 @@ un problème de spécification ?
223
223
# 1. Régression linéaire de per_gop sur différentes variables explicatives
224
224
xvars = ['Unemployment_rate_2019', 'Median_Household_Income_2019', 'Percent of adults with less than a high school diploma, 2015-19', "Percent of adults with a bachelor's degree or higher, 2015-19"]
@@ -335,10 +335,11 @@ en `log` sinon son échelle risque d'écraser tout effet.
335
335
# 1. Régression linéaire de per_gop sur différentes variables explicatives
336
336
xvars = ['Unemployment_rate_2019', 'Median_Household_Income_2019', 'Percent of adults with less than a high school diploma, 2015-19', "Percent of adults with a bachelor's degree or higher, 2015-19"]
337
337
338
-
df2 = votes[["per_gop"] + xvars]
338
+
xvars = ['Unemployment_rate_2019', 'Median_Household_Income_2019', 'Percent of adults with less than a high school diploma, 2015-19', "Percent of adults with a bachelor's degree or higher, 2015-19"]
X = sm.add_constant(df2.drop(["Median_Household_Income_2019","per_gop"], axis = 1))
344
345
results = sm.OLS(df2[['per_gop']], X).fit()
@@ -487,10 +488,10 @@ une mesure de qualité du modèle.
487
488
#1. Modèle logit avec les mêmes variables que précédemment
488
489
xvars = ['Unemployment_rate_2019', 'Median_Household_Income_2019', 'Percent of adults with less than a high school diploma, 2015-19', "Percent of adults with a bachelor's degree or higher, 2015-19"]
0 commit comments