Does political score explains variation in alcohol consumption?
My model with data from Gapminder is:
model2 = smf.ols(formula='alcconsumption ~ C(polityscore)', data=sub).fit()
print (model2.summary())
At first look the result looks like there polityscore can explain variations in alcohol consumption.
Output:
OLS Regression Results
==============================================================================
Dep. Variable: alcconsumption R-squared: 0.326
Model: OLS Adj. R-squared: 0.227
Method: Least Squares F-statistic: 3.309
Date: Sun, 14 Feb 2016 Prob (F-statistic): 1.79e-05
Time: 13:54:24 Log-Likelihood: -451.31
No. Observations: 158 AIC: 944.6
Df Residuals: 137 BIC: 1009.
Df Model: 20
Covariance Type: nonrobust
==========================================================================================
coef std err t P>|t| [95.0% Conf. Int.]
------------------------------------------------------------------------------------------
Intercept 0.8150 3.197 0.255 0.799 -5.507 7.137
C(polityscore)[T.-9.0] 3.7383 4.127 0.906 0.367 -4.423 11.899
C(polityscore)[T.-8.0] -0.0950 4.521 -0.021 0.983 -9.035 8.845
C(polityscore)[T.-7.0] 4.3783 3.453 1.268 0.207 -2.450 11.206
C(polityscore)[T.-6.0] 3.4917 4.127 0.846 0.399 -4.669 11.653
C(polityscore)[T.-5.0] 4.0350 4.521 0.892 0.374 -4.905 12.975
C(polityscore)[T.-4.0] 2.6267 3.691 0.712 0.478 -4.673 9.926
C(polityscore)[T.-3.0] 2.9000 3.691 0.786 0.433 -4.400 10.200
C(polityscore)[T.-2.0] 1.5470 3.783 0.409 0.683 -5.933 9.027
C(polityscore)[T.-1.0] 6.2400 3.915 1.594 0.113 -1.502 13.982
C(polityscore)[T.0.0] 1.8700 3.691 0.507 0.613 -5.430 9.170
C(polityscore)[T.1.0] 3.7783 4.127 0.915 0.362 -4.383 11.939
C(polityscore)[T.2.0] 1.6083 4.127 0.390 0.697 -6.553 9.769
C(polityscore)[T.3.0] 4.1850 4.521 0.926 0.356 -4.755 13.125
C(polityscore)[T.4.0] 9.1025 3.915 2.325 0.022 1.360 16.845
C(polityscore)[T.5.0] 4.1693 3.625 1.150 0.252 -2.999 11.337
C(polityscore)[T.6.0] 4.3460 3.502 1.241 0.217 -2.579 11.271
C(polityscore)[T.7.0] 3.8642 3.434 1.125 0.262 -2.926 10.655
C(polityscore)[T.8.0] 8.2171 3.361 2.445 0.016 1.571 14.863
C(polityscore)[T.9.0] 8.1736 3.418 2.392 0.018 1.416 14.932
C(polityscore)[T.10.0] 9.6331 3.295 2.923 0.004 3.117 16.149
==============================================================================
Omnibus: 17.250 Durbin-Watson: 1.909
Prob(Omnibus): 0.000 Jarque-Bera (JB): 19.895
Skew: 0.750 Prob(JB): 4.79e-05
Kurtosis: 3.880 Cond. No. 43.1
==============================================================================
Warnings:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
Then we have a look at the relationship between mean polityscore and alcconsumption
means for alcconsumption by polityscore
alcconsumption
polityscore
-10.00 0.82
-9.00 4.55
-8.00 0.72
-7.00 5.19
-6.00 4.31
-5.00 4.85
-4.00 3.44
-3.00 3.71
-2.00 2.36
-1.00 7.05
0.00 2.69
1.00 4.59
2.00 2.42
3.00 5.00
4.00 9.92
5.00 4.98
6.00 5.16
7.00 4.68
8.00 9.03
9.00 8.99
10.00 10.45
The null hypoteses
is that the alcohol variations is explained by politics. A tukey test, that accounts for what levels of politicscore are affecting the output shows that there is seldom a level that rejects the null hypotesis. We should be doubting that there is a influence.
Multiple Comparison of Means - Tukey HSD,FWER=0.05
==============================================
group1 group2 meandiff lower upper reject
----------------------------------------------
-10.0 -9.0 3.7383 -11.2896 18.7663 False
-10.0 -8.0 -0.095 -16.5573 16.3673 False
-10.0 -7.0 4.3783 -8.1949 16.9516 False
-10.0 -6.0 3.4917 -11.5363 18.5196 False
-10.0 -5.0 4.035 -12.4273 20.4973 False
-10.0 -4.0 2.6267 -10.8147 16.0681 False
-10.0 -3.0 2.9 -10.5414 16.3414 False
-10.0 -2.0 1.547 -12.2263 15.3203 False
-10.0 -1.0 6.24 -8.0168 20.4968 False
-10.0 0.0 1.87 -11.5714 15.3114 False
-10.0 1.0 3.7783 -11.2496 18.8063 False
-10.0 2.0 1.6083 -13.4196 16.6363 False
-10.0 3.0 4.185 -12.2773 20.6473 False
-10.0 4.0 9.1025 -5.1543 23.3593 False
-10.0 5.0 4.1693 -9.0299 17.3685 False
-10.0 6.0 4.346 -8.4056 17.0976 False
-10.0 7.0 3.8642 -8.6398 16.3682 False
-10.0 8.0 8.2171 -4.0208 20.455 False
-10.0 9.0 8.1736 -4.2707 20.6179 False
-10.0 10.0 9.6331 -2.3657 21.632 False
-9.0 -8.0 -3.8333 -18.8613 11.1946 False
-9.0 -7.0 0.64 -9.9864 11.2664 False
-9.0 -6.0 -0.2467 -13.6881 13.1947 False
-9.0 -5.0 0.2967 -14.7313 15.3246 False
-9.0 -4.0 -1.1117 -12.7523 10.5289 False
-9.0 -3.0 -0.8383 -12.4789 10.8023 False
-9.0 -2.0 -2.1913 -14.2137 9.831 False
-9.0 -1.0 2.5017 -10.0716 15.0749 False
-9.0 0.0 -1.8683 -13.5089 9.7723 False
-9.0 1.0 0.04 -13.4014 13.4814 False
-9.0 2.0 -2.13 -15.5714 11.3114 False
-9.0 3.0 0.4467 -14.5813 15.4746 False
-9.0 4.0 5.3642 -7.2091 17.9374 False
-9.0 5.0 0.431 -10.9291 11.791 False
-9.0 6.0 0.6077 -10.2291 11.4445 False
-9.0 7.0 0.1259 -10.4184 10.6702 False
-9.0 8.0 4.4788 -5.7486 14.7061 False
-9.0 9.0 4.4352 -6.0382 14.9087 False
-9.0 10.0 5.8948 -4.0453 15.8348 False
-8.0 -7.0 4.4733 -8.0999 17.0466 False
-8.0 -6.0 3.5867 -11.4413 18.6146 False
-8.0 -5.0 4.13 -12.3323 20.5923 False
-8.0 -4.0 2.7217 -10.7197 16.1631 False
-8.0 -3.0 2.995 -10.4464 16.4364 False
-8.0 -2.0 1.642 -12.1313 15.4153 False
-8.0 -1.0 6.335 -7.9218 20.5918 False
-8.0 0.0 1.965 -11.4764 15.4064 False
-8.0 1.0 3.8733 -11.1546 18.9013 False
-8.0 2.0 1.7033 -13.3246 16.7313 False
-8.0 3.0 4.28 -12.1823 20.7423 False
-8.0 4.0 9.1975 -5.0593 23.4543 False
-8.0 5.0 4.2643 -8.9349 17.4635 False
-8.0 6.0 4.441 -8.3106 17.1926 False
-8.0 7.0 3.9592 -8.5448 16.4632 False
-8.0 8.0 8.3121 -3.9258 20.55 False
-8.0 9.0 8.2686 -4.1757 20.7129 False
-8.0 10.0 9.7281 -2.2707 21.727 False
-7.0 -6.0 -0.8867 -11.513 9.7397 False
-7.0 -5.0 -0.3433 -12.9166 12.2299 False
-7.0 -4.0 -1.7517 -9.9828 6.4795 False
-7.0 -3.0 -1.4783 -9.7095 6.7528 False
-7.0 -2.0 -2.8313 -11.5941 5.9314 False
-7.0 -1.0 1.8617 -7.6428 11.3662 False
-7.0 0.0 -2.5083 -10.7395 5.7228 False
-7.0 1.0 -0.6 -11.2264 10.0264 False
-7.0 2.0 -2.77 -13.3964 7.8564 False
-7.0 3.0 -0.1933 -12.7666 12.3799 False
-7.0 4.0 4.7242 -4.7803 14.2287 False
-7.0 5.0 -0.209 -8.0384 7.6203 False
-7.0 6.0 -0.0323 -7.0811 7.0164 False
-7.0 7.0 -0.5141 -7.1043 6.0761 False
-7.0 8.0 3.8388 -2.2314 9.909 False
-7.0 9.0 3.7952 -2.681 10.2715 False
-7.0 10.0 5.2548 -0.3177 10.8273 False
-6.0 -5.0 0.5433 -14.4846 15.5713 False
-6.0 -4.0 -0.865 -12.5056 10.7756 False
-6.0 -3.0 -0.5917 -12.2323 11.0489 False
-6.0 -2.0 -1.9447 -13.967 10.0777 False
-6.0 -1.0 2.7483 -9.8249 15.3216 False
-6.0 0.0 -1.6217 -13.2623 10.0189 False
-6.0 1.0 0.2867 -13.1547 13.7281 False
-6.0 2.0 -1.8833 -15.3247 11.5581 False
-6.0 3.0 0.6933 -14.3346 15.7213 False
-6.0 4.0 5.6108 -6.9624 18.1841 False
-6.0 5.0 0.6776 -10.6824 12.0377 False
-6.0 6.0 0.8543 -9.9825 11.6911 False
-6.0 7.0 0.3726 -10.1717 10.9169 False
-6.0 8.0 4.7254 -5.5019 14.9528 False
-6.0 9.0 4.6819 -5.7916 15.1554 False
-6.0 10.0 6.1415 -3.7986 16.0815 False
-5.0 -4.0 -1.4083 -14.8497 12.0331 False
-5.0 -3.0 -1.135 -14.5764 12.3064 False
-5.0 -2.0 -2.488 -16.2613 11.2853 False
-5.0 -1.0 2.205 -12.0518 16.4618 False
-5.0 0.0 -2.165 -15.6064 11.2764 False
-5.0 1.0 -0.2567 -15.2846 14.7713 False
-5.0 2.0 -2.4267 -17.4546 12.6013 False
-5.0 3.0 0.15 -16.3123 16.6123 False
-5.0 4.0 5.0675 -9.1893 19.3243 False
-5.0 5.0 0.1343 -13.0649 13.3335 False
-5.0 6.0 0.311 -12.4406 13.0626 False
-5.0 7.0 -0.1708 -12.6748 12.3332 False
-5.0 8.0 4.1821 -8.0558 16.42 False
-5.0 9.0 4.1386 -8.3057 16.5829 False
-5.0 10.0 5.5981 -6.4007 17.597 False
-4.0 -3.0 0.2733 -9.2312 9.7778 False
-4.0 -2.0 -1.0797 -11.0481 8.8887 False
-4.0 -1.0 3.6133 -7.013 14.2397 False
-4.0 0.0 -0.7567 -10.2612 8.7478 False
-4.0 1.0 1.1517 -10.4889 12.7923 False
-4.0 2.0 -1.0183 -12.6589 10.6223 False
-4.0 3.0 1.5583 -11.8831 14.9997 False
-4.0 4.0 6.4758 -4.1505 17.1022 False
-4.0 5.0 1.5426 -7.6162 10.7014 False
-4.0 6.0 1.7193 -6.7818 10.2204 False
-4.0 7.0 1.2376 -6.8874 9.3625 False
-4.0 8.0 5.5904 -2.1187 13.2996 False
-4.0 9.0 5.5469 -2.4859 13.5797 False
-4.0 10.0 7.0065 -0.3173 14.3302 False
-3.0 -2.0 -1.353 -11.3214 8.6154 False
-3.0 -1.0 3.34 -7.2864 13.9664 False
-3.0 0.0 -1.03 -10.5345 8.4745 False
-3.0 1.0 0.8783 -10.7623 12.5189 False
-3.0 2.0 -1.2917 -12.9323 10.3489 False
-3.0 3.0 1.285 -12.1564 14.7264 False
-3.0 4.0 6.2025 -4.4239 16.8289 False
-3.0 5.0 1.2693 -7.8895 10.4281 False
-3.0 6.0 1.446 -7.0551 9.9471 False
-3.0 7.0 0.9642 -7.1607 9.0892 False
-3.0 8.0 5.3171 -2.3921 13.0263 False
-3.0 9.0 5.2736 -2.7592 13.3063 False
-3.0 10.0 6.7331 -0.5906 14.0568 False
-2.0 -1.0 4.693 -6.3502 15.7362 False
-2.0 0.0 0.323 -9.6454 10.2914 False
-2.0 1.0 2.2313 -9.791 14.2537 False
-2.0 2.0 0.0613 -11.961 12.0837 False
-2.0 3.0 2.638 -11.1353 16.4113 False
-2.0 4.0 7.5555 -3.4877 18.5987 False
-2.0 5.0 2.6223 -7.017 12.2616 False
-2.0 6.0 2.799 -6.2178 11.8158 False
-2.0 7.0 2.3172 -6.3458 10.9803 False
-2.0 8.0 6.6701 -1.6042 14.9445 False
-2.0 9.0 6.6266 -1.9501 15.2032 False
-2.0 10.0 8.0861 0.1697 16.0026 True
-1.0 0.0 -4.37 -14.9964 6.2564 False
-1.0 1.0 -2.4617 -15.0349 10.1116 False
-1.0 2.0 -4.6317 -17.2049 7.9416 False
-1.0 3.0 -2.055 -16.3118 12.2018 False
-1.0 4.0 2.8625 -8.7781 14.5031 False
-1.0 5.0 -2.0707 -12.389 8.2476 False
-1.0 6.0 -1.894 -11.6332 7.8452 False
-1.0 7.0 -2.3758 -11.7884 7.0369 False
-1.0 8.0 1.9771 -7.0791 11.0333 False
-1.0 9.0 1.9336 -7.3997 11.2668 False
-1.0 10.0 3.3931 -5.3373 12.1236 False
0.0 1.0 1.9083 -9.7323 13.5489 False
0.0 2.0 -0.2617 -11.9023 11.3789 False
0.0 3.0 2.315 -11.1264 15.7564 False
0.0 4.0 7.2325 -3.3939 17.8589 False
0.0 5.0 2.2993 -6.8595 11.4581 False
0.0 6.0 2.476 -6.0251 10.9771 False
0.0 7.0 1.9942 -6.1307 10.1192 False
0.0 8.0 6.3471 -1.3621 14.0563 False
0.0 9.0 6.3036 -1.7292 14.3363 False
0.0 10.0 7.7631 0.4394 15.0868 True
1.0 2.0 -2.17 -15.6114 11.2714 False
1.0 3.0 0.4067 -14.6213 15.4346 False
1.0 4.0 5.3242 -7.2491 17.8974 False
1.0 5.0 0.391 -10.9691 11.751 False
1.0 6.0 0.5677 -10.2691 11.4045 False
1.0 7.0 0.0859 -10.4584 10.6302 False
1.0 8.0 4.4388 -5.7886 14.6661 False
1.0 9.0 4.3952 -6.0782 14.8687 False
1.0 10.0 5.8548 -4.0853 15.7948 False
2.0 3.0 2.5767 -12.4513 17.6046 False
2.0 4.0 7.4942 -5.0791 20.0674 False
2.0 5.0 2.561 -8.7991 13.921 False
2.0 6.0 2.7377 -8.0991 13.5745 False
2.0 7.0 2.2559 -8.2884 12.8002 False
2.0 8.0 6.6088 -3.6186 16.8361 False
2.0 9.0 6.5652 -3.9082 17.0387 False
2.0 10.0 8.0248 -1.9153 17.9648 False
3.0 4.0 4.9175 -9.3393 19.1743 False
3.0 5.0 -0.0157 -13.2149 13.1835 False
3.0 6.0 0.161 -12.5906 12.9126 False
3.0 7.0 -0.3208 -12.8248 12.1832 False
3.0 8.0 4.0321 -8.2058 16.27 False
3.0 9.0 3.9886 -8.4557 16.4329 False
3.0 10.0 5.4481 -6.5507 17.447 False
4.0 5.0 -4.9332 -15.2515 5.3851 False
4.0 6.0 -4.7565 -14.4957 4.9827 False
4.0 7.0 -5.2383 -14.6509 4.1744 False
4.0 8.0 -0.8854 -9.9416 8.1708 False
4.0 9.0 -0.9289 -10.2622 8.4043 False
4.0 10.0 0.5306 -8.1998 9.2611 False
5.0 6.0 0.1767 -7.936 8.2894 False
5.0 7.0 -0.3051 -8.0227 7.4126 False
5.0 8.0 4.0478 -3.2308 11.3265 False
5.0 9.0 4.0043 -3.6163 11.6248 False
5.0 10.0 5.4638 -1.4052 12.3329 False
6.0 7.0 -0.4818 -7.4062 6.4426 False
6.0 8.0 3.8711 -2.5604 10.3026 False
6.0 9.0 3.8276 -2.9885 10.6436 False
6.0 10.0 5.2871 -0.6769 11.2512 False
7.0 8.0 4.3529 -1.5725 10.2783 False
7.0 9.0 4.3093 -2.0313 10.65 False
7.0 10.0 5.7689 0.3545 11.1833 True
8.0 9.0 -0.0435 -5.8419 5.7548 False
8.0 10.0 1.416 -3.3518 6.1839 False
9.0 10.0 1.4596 -3.8155 6.7346 False
----------------------------------------------
No comments:
Post a Comment