Skip to content

Best regressions? #10

@cmcaine

Description

@cmcaine

Best regressions I've found so far for England and for the whole of the UK. Years picked for change_since are chosen by a for loop. Details in source, but it's pretty simple.

England benefits from IMD data slightly, but also just from excluding the other areas:

# ipython -i brellenge_prep.py

# bestEng = smf.ols('Pct_Remain ~ Q("White British") + Q("White Other") + Asian + Black + Other + y2015_WBR + IMD', data=change_since(2016, 2001).join(metadata))
# bestUK = smf.ols('Pct_Remain ~ Q("White British") + Q("White Other") + Asian + Black + Other + y2015_WBR', data=change_since(2017, 2003).join(metadata))

In [1]: bestEng.fit().summary2()
Out[1]: 
<class 'statsmodels.iolib.summary2.Summary'>
"""
                   Results: Ordinary least squares
======================================================================
Model:                OLS               Adj. R-squared:      0.624    
Dependent Variable:   Pct_Remain        AIC:                 2109.8669
Date:                 2018-03-04 15:19  BIC:                 2140.1375
No. Observations:     325               Log-Likelihood:      -1046.9  
Df Model:             7                 F-statistic:         77.81    
Df Residuals:         317               Prob (F-statistic):  4.59e-65 
R-squared:            0.632             Scale:               37.702   
----------------------------------------------------------------------
                    Coef.   Std.Err.    t    P>|t|    [0.025   0.975] 
----------------------------------------------------------------------
Intercept          123.1056  14.3254  8.5935 0.0000   94.9207 151.2905
Q("White British") -65.0829  19.6060 -3.3195 0.0010 -103.6572 -26.5086
Q("White Other")     9.7304   4.2564  2.2861 0.0229    1.3561  18.1046
Asian               -9.4880   2.8771 -3.2977 0.0011  -15.1487  -3.8273
Black               46.3033   4.4566 10.3899 0.0000   37.5351  55.0715
Other               -0.8730   4.9839 -0.1752 0.8611  -10.6786   8.9326
y2015_WBR          -48.5744  18.5010 -2.6255 0.0091  -84.9746 -12.1742
IMD                  1.4646   0.2204  6.6449 0.0000    1.0310   1.8983
----------------------------------------------------------------------
Omnibus:               12.016         Durbin-Watson:            1.845 
Prob(Omnibus):         0.002          Jarque-Bera (JB):         12.578
Skew:                  0.418          Prob(JB):                 0.002 
Kurtosis:              3.478          Condition No.:            572   
======================================================================

"""

In [2]: bestUK.fit().summary2()
Out[2]: 
<class 'statsmodels.iolib.summary2.Summary'>
"""
                   Results: Ordinary least squares
=====================================================================
Model:               OLS               Adj. R-squared:      0.547    
Dependent Variable:  Pct_Remain        AIC:                 2300.3152
Date:                2018-03-04 15:19  BIC:                 2327.2605
No. Observations:    347               Log-Likelihood:      -1143.2  
Df Model:            6                 F-statistic:         70.53    
Df Residuals:        340               Prob (F-statistic):  9.16e-57 
R-squared:           0.555             Scale:               43.437   
---------------------------------------------------------------------
                    Coef.   Std.Err.    t    P>|t|   [0.025   0.975] 
---------------------------------------------------------------------
Intercept          119.1428  13.0029  9.1628 0.0000  93.5666 144.7191
Q("White British") -55.5533  20.2003 -2.7501 0.0063 -95.2866 -15.8199
Q("White Other")    30.5484   3.9682  7.6984 0.0000  22.7432  38.3537
Asian               -9.0141   2.6544 -3.3959 0.0008 -14.2351  -3.7930
Black               24.8085   3.5454  6.9974 0.0000  17.8348  31.7822
Other                4.5733   4.9236  0.9289 0.3536  -5.1112  14.2578
y2015_WBR          -35.2234  15.8739 -2.2190 0.0271 -66.4467  -4.0000
---------------------------------------------------------------------
Omnibus:                3.247         Durbin-Watson:            1.823
Prob(Omnibus):          0.197         Jarque-Bera (JB):         2.962
Skew:                   0.207         Prob(JB):                 0.227
Kurtosis:               3.181         Condition No.:            148  
=====================================================================

"""

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions