How diverse can spatial measures of cultural segregation be?

Results from Monte Carlo simulations of an agent-based model

[Dani Arribas-Bel, Peter Nijkamp & Jacques Poot]

Results and code

Visualizations

This page presents several additional figures that were not included in the paper but that were used in the analysis and may be of interest for readers. In addition, this page also shows the code required to create them. The page has the following sections:

Simulation output processing

In [1]:
%matplotlib inline

import os, sys
import pandas as pd
import pysal as ps
import results as tools
import statsmodels.formula.api as sm
import matplotlib.pyplot as plt
In [2]:
def _encode(cs):
    if cs['Yn'] == 5:
        return 'dense'
    elif cs['Yn'] == 10:
        return 'sprawl'
    else:
        return None

Read data

In [3]:
inds = pd.read_csv('sim_res.csv')\
                    .set_index(['tau', 'prop_mix', 'rep_id', 'group'])
In [4]:
inds.info()
<class 'pandas.core.frame.DataFrame'>
MultiIndex: 468688 entries, (0.0, 0.7_0.1_0.1_0.1, 0, g0-0.70) to (0.337931034483, 0.2_0.2_0.2_0.2_0.2, 499, g4-0.20)
Data columns (total 8 columns):
ellison_glaeser_egg_pop    468688 non-null float64
isolation_ii               468688 non-null float64
segregation_gsg            468688 non-null float64
theil_th                   468688 non-null float64
ticks                      468688 non-null int64
vacr                       468688 non-null float64
city                       468688 non-null object
job                        468688 non-null int64
dtypes: float64(5), int64(2), object(1)
memory usage: 30.8+ MB

In [5]:
inds.head()
Out[5]:
ellison_glaeser_egg_pop isolation_ii segregation_gsg theil_th ticks vacr city job
tau prop_mix rep_id group
0 0.7_0.1_0.1_0.1 0 g0-0.70 -0.000264 1.037704 0.140063 0.044388 0 0.25 sprawl 10
g1-0.10 -0.000837 1.201116 0.191111 0.044388 0 0.25 sprawl 10
g2-0.10 -0.000266 1.267656 0.218074 0.044388 0 0.25 sprawl 10
g3-0.10 -0.000077 1.282360 0.226370 0.044388 0 0.25 sprawl 10
1 g0-0.70 -0.000258 1.040111 0.148825 0.043880 0 0.25 sprawl 10

Simulation descriptives

The following figures represent the equivalent of Figure 3 in the submitted version and describe the average number of iterations as well as the number of draws the simulation performed for a given combination of population structure and value of $\tau$. There are four figures, one for each pair of type of city ("dense", "sprawl") and vacancy rate.

In [6]:
inds.xs('0.7_0.3', level='prop_mix').loc[('city'=='dense') & ('vacr'==0.25), :].head()
Out[6]:
ellison_glaeser_egg_pop isolation_ii segregation_gsg theil_th ticks vacr city job
rep_id group
0 g0-0.70 -0.000286 1.007726 0.061714 0.004440 0 0.25 dense 3
g1-0.30 -0.000373 1.018028 0.061714 0.004440 0 0.25 dense 3
1 g0-0.70 -0.000251 1.010429 0.074794 0.006025 0 0.25 dense 3
g1-0.30 -0.000180 1.024335 0.074794 0.006025 0 0.25 dense 3
2 g0-0.70 -0.000244 1.011023 0.081905 0.006402 0 0.25 dense 3
In [7]:
for (city, vacr), sce in inds.groupby(['city', 'vacr']):
    print city, vacr
    out, ts = tools.build_convfreqs(sce)
    if (city == 'dense') and (vacr == 0.25):
        out, ts = tools.build_convfreqs(sce)
        out, ts = tools.build_convfreqs(sce)
dense 0.15

dense 0.25

sprawl 0.15

sprawl 0.25

Main results

  • Mean values
In [8]:
for (city, vacr), sce in inds.groupby(['city', 'vacr']):
    print '####################################################'
    print city, vacr
    scetp = tools.build_tauplot_by_scenario(sce.drop(['city', 'job', 'vacr'], axis=1), \
                                            scenarios=\
                                        ['0.5_0.5', '0.7_0.3', \
                                         '0.4_0.4_0.1_0.1', \
                                         '0.7_0.1_0.1_0.1', \
                                         '0.4_0.3_0.2_0.1', \
                                         '0.2_0.2_0.2_0.2_0.2'])
####################################################
dense 0.15
Plotting scenario  0.5_0.5
Plotting scenario  0.7_0.3
Plotting scenario  0.4_0.4_0.1_0.1
Plotting scenario  0.7_0.1_0.1_0.1
Plotting scenario  0.4_0.3_0.2_0.1
Plotting scenario  0.2_0.2_0.2_0.2_0.2

####################################################
dense 0.25
Plotting scenario  0.5_0.5
Plotting scenario  0.7_0.3
Plotting scenario  0.4_0.4_0.1_0.1
Plotting scenario  0.7_0.1_0.1_0.1
Plotting scenario  0.4_0.3_0.2_0.1
Plotting scenario  0.2_0.2_0.2_0.2_0.2

####################################################
sprawl 0.15
Plotting scenario  0.5_0.5
Plotting scenario  0.7_0.3
Plotting scenario  0.4_0.4_0.1_0.1
Plotting scenario  0.7_0.1_0.1_0.1
Plotting scenario  0.4_0.3_0.2_0.1
Plotting scenario  0.2_0.2_0.2_0.2_0.2

####################################################
sprawl 0.25
Plotting scenario  0.5_0.5
Plotting scenario  0.7_0.3
Plotting scenario  0.4_0.4_0.1_0.1
Plotting scenario  0.7_0.1_0.1_0.1
Plotting scenario  0.4_0.3_0.2_0.1
Plotting scenario  0.2_0.2_0.2_0.2_0.2

  • Std values
In [9]:
for (city, vacr), sce in inds.groupby(['city', 'vacr']):
    print '####################################################'
    print city, vacr
    scetp = tools.build_tauplot_by_scenario(sce.drop(['city', 'job', 'vacr'], axis=1), \
                                            scenarios=\
                                        ['0.5_0.5', '0.7_0.3', \
                                         '0.4_0.4_0.1_0.1', \
                                         '0.7_0.1_0.1_0.1', \
                                         '0.4_0.3_0.2_0.1', \
                                         '0.2_0.2_0.2_0.2_0.2'], \
                                        fun='std')
####################################################
dense 0.15
Plotting scenario  0.5_0.5
Plotting scenario  0.7_0.3
Plotting scenario  0.4_0.4_0.1_0.1
Plotting scenario  0.7_0.1_0.1_0.1
Plotting scenario  0.4_0.3_0.2_0.1
Plotting scenario  0.2_0.2_0.2_0.2_0.2

####################################################
dense 0.25
Plotting scenario  0.5_0.5
Plotting scenario  0.7_0.3
Plotting scenario  0.4_0.4_0.1_0.1
Plotting scenario  0.7_0.1_0.1_0.1
Plotting scenario  0.4_0.3_0.2_0.1
Plotting scenario  0.2_0.2_0.2_0.2_0.2

####################################################
sprawl 0.15
Plotting scenario  0.5_0.5
Plotting scenario  0.7_0.3
Plotting scenario  0.4_0.4_0.1_0.1
Plotting scenario  0.7_0.1_0.1_0.1
Plotting scenario  0.4_0.3_0.2_0.1
Plotting scenario  0.2_0.2_0.2_0.2_0.2

####################################################
sprawl 0.25
Plotting scenario  0.5_0.5
Plotting scenario  0.7_0.3
Plotting scenario  0.4_0.4_0.1_0.1
Plotting scenario  0.7_0.1_0.1_0.1
Plotting scenario  0.4_0.3_0.2_0.1
Plotting scenario  0.2_0.2_0.2_0.2_0.2

  • Mean + Std graphs
In [10]:
g = inds[(inds['vacr']==0.25) & (inds['city']=='dense')]['theil_th']\
                 .groupby(level=['prop_mix', 'tau', 'rep_id']).first()\
                 .groupby(level=['prop_mix', 'tau']).agg(['mean', 'std'])

X range particular to each scenario:

In [11]:
tools.build_meanStd_plots(g, stdX=False)
tools.build_meanStd_plots(g, stdX=False)

X range standardized across scenarios:

In [12]:
tools.build_meanStd_plots(g, stdX=True)
tools.build_meanStd_plots(g, stdX=True)

Response surface analysis

In [13]:
db = inds.reset_index()
db['sprawl'] = 1
db.loc[db['city']=='dense', 'sprawl'] = 0
db['group_in_mix'] = db['prop_mix'] + '|' + db['group']
db.info()
<class 'pandas.core.frame.DataFrame'>
Int64Index: 468688 entries, 0 to 468687
Data columns (total 14 columns):
tau                        468688 non-null float64
prop_mix                   468688 non-null object
rep_id                     468688 non-null int64
group                      468688 non-null object
ellison_glaeser_egg_pop    468688 non-null float64
isolation_ii               468688 non-null float64
segregation_gsg            468688 non-null float64
theil_th                   468688 non-null float64
ticks                      468688 non-null int64
vacr                       468688 non-null float64
city                       468688 non-null object
job                        468688 non-null int64
sprawl                     468688 non-null int64
group_in_mix               468688 non-null object
dtypes: float64(6), int64(4), object(4)
memory usage: 53.6+ MB

Response surface analysis is about extrapolating conclusions from a simulation into cases not explicitly considered by the experiment itself. In particular, it is usually done through the estimation of a regression that looks at the impact of different simulation parameters on the outcome.

In [14]:
vari = 'mean'
means = db.groupby(['prop_mix', 'group_in_mix', 'tau', 'vacr', 'sprawl'])\
                          .agg({'rep_id': 'size', \
                                'ticks': vari, \
                                'ellison_glaeser_egg_pop': vari, \
                                'isolation_ii': vari, \
                                'segregation_gsg': vari, \
                                'theil_th': vari})\
                          .reset_index()
means['tau2'] = means['tau']**2
means['tau3'] = means['tau']**3
means.loc[means['vacr']==0.15, 'vacr'] = 0
means.loc[means['vacr']==0.25, 'vacr'] = 1

Averaging over the draws of each combination of tau, proportion mix, group, vacancy rate and density setup, we can run regressions on the average and std values of each index tested, using the following variables as explanatory ones:

In [15]:
name_y = ['isolation_ii', 'segregation_gsg', 'ellison_glaeser_egg_pop']

Additionally, for the Theil index, we need to create a different dataset, so it is run separately.

Models

In [16]:
rsa = {}

xs = ['tau', 'tau2', 'tau3', 'vacr', 'sprawl']
xd = pd.get_dummies(means['group_in_mix'], prefix='gim_')
xd = xd.rename(columns={'gim__0.5_0.5|g0-0.50': 'Intercept'})
xd['Intercept'] = 1
x = means[xs].join(xd)

for y in name_y:
    ols = sm.OLS(means[y], x).fit()
    rsa[y] = ols

# Theil
meanT = means.groupby(['tau', 'prop_mix', 'vacr', 'sprawl', 'rep_id'])\
             .first()\
             .reset_index()
xdt = pd.get_dummies(meanT['prop_mix'], prefix='pm_')
xdt = xdt.rename(columns={'pm__0.5_0.5': 'Intercept'})
xdt['Intercept'] = 1
xt = meanT[xs].join(xdt)
ols = sm.OLS(meanT['theil_th'], xt).fit()
rsa['theil_th'] = ols

We can obtain a summarizing table of all the models:

In [17]:
def starify(p):
    if p < 0.001:
        return '***'
    elif 0.01 <= p < 0.05:
        return '**'
    elif 0.05 <= p < 0.1:
        return '*'
    else:
        return ''
table = {}
for model in rsa:
    table[(model, 'beta')] = pd.np.round(rsa[model].params, 4)
    table[(model, 'sig')] = rsa[model].pvalues.apply(starify)
table = pd.DataFrame(table)
order = ['tau', 'tau2', 'tau3', 'vacr', 'sprawl', 'Intercept'] \
         + [i for i in table.index if 'm_' in i]
final_tab = table.reindex(order).fillna('')
final_tab
Out[17]:
ellison_glaeser_egg_pop isolation_ii segregation_gsg theil_th
beta sig beta sig beta sig beta sig
tau 0.2699 *** 7.1544 *** 2.2039 *** 0.367
tau2 -0.1691 20.9009 *** -0.0524 5.1663
tau3 -0.1461 -35.2096 *** -0.3259 -4.1045 **
vacr 0.0017 0.0432 0.0126 0.0103
sprawl -0.0263 *** 0.2366 *** 0.0863 *** 0.0579
Intercept -0.0323 *** -1.2615 *** -0.3538 *** -0.2729 ***
gim__0.2_0.2_0.2_0.2_0.2|g0-0.20 0.0471 *** 2.5807 *** 0.4495 ***
gim__0.2_0.2_0.2_0.2_0.2|g1-0.20 0.0471 *** 2.5822 *** 0.4497 ***
gim__0.2_0.2_0.2_0.2_0.2|g2-0.20 0.0471 *** 2.582 *** 0.4496 ***
gim__0.2_0.2_0.2_0.2_0.2|g3-0.20 0.0472 *** 2.5841 *** 0.4499 ***
gim__0.2_0.2_0.2_0.2_0.2|g4-0.20 0.0471 *** 2.5815 *** 0.4496 ***
gim__0.4_0.3_0.2_0.1|g0-0.40 0.0231 *** 1.2671 *** 0.219 ***
gim__0.4_0.3_0.2_0.1|g1-0.30 0.0238 *** 1.3574 *** 0.2529 ***
gim__0.4_0.3_0.2_0.1|g2-0.20 0.0281 *** 1.6945 *** 0.3575 ***
gim__0.4_0.3_0.2_0.1|g3-0.10 0.0611 *** 3.2621 *** 0.6071 ***
gim__0.4_0.4_0.1_0.1|g0-0.40 0.0291 *** 1.6252 *** 0.2908 ***
gim__0.4_0.4_0.1_0.1|g1-0.40 0.0291 *** 1.6249 *** 0.2907 ***
gim__0.4_0.4_0.1_0.1|g2-0.10 0.0483 *** 2.6105 *** 0.5625 ***
gim__0.4_0.4_0.1_0.1|g3-0.10 0.0477 *** 2.5985 *** 0.5612 ***
gim__0.5_0.5|g1-0.50 -0 -0 -0
gim__0.7_0.1_0.1_0.1|g0-0.70 0.0275 *** 1.5837 *** 0.3778 ***
gim__0.7_0.1_0.1_0.1|g1-0.10 0.056 *** 2.9086 *** 0.596 ***
gim__0.7_0.1_0.1_0.1|g2-0.10 0.0557 *** 2.8985 *** 0.5955 ***
gim__0.7_0.1_0.1_0.1|g3-0.10 0.0565 *** 2.9468 *** 0.598 ***
gim__0.7_0.3|g0-0.70 0.0106 * 0.7547 *** 0.1567 ***
gim__0.7_0.3|g1-0.30 0.0122 ** 0.8667 *** 0.1567 ***
pm__0.2_0.2_0.2_0.2_0.2 0.4644 ***
pm__0.4_0.3_0.2_0.1 0.2663 ***
pm__0.4_0.4_0.1_0.1 0.2862 ***
pm__0.7_0.1_0.1_0.1 0.3931 ***
pm__0.7_0.3 0.1202 ***

Main Effect Plots

In [18]:
f, axs = plt.subplots(1, 4, figsize=(12, 3))
axs = axs.ravel()

for y, ax in zip(name_y, axs):
    betas = rsa[y].params
    ax = tools.main_effect_plot(y, 'tau', betas, \
                                x.join(means[y]), ax=ax)
    ax.set_title(y)

y = 'theil_th'
betas = rsa[y].params
ax = tools.main_effect_plot(y, 'tau', betas, \
                            xt.join(meanT[y]), ax=axs[-1])
ax.set_title(y)
plt.tight_layout()

plt.show()

Full tables

The full models can also be printed (for online access only):

In [19]:
for model in rsa:
    print '\n#############################'
    print model
    print '#############################'
    print rsa[model].summary2()

#############################
isolation_ii
#############################
                          Results: Ordinary least squares
===================================================================================
Model:                     OLS                   Adj. R-squared:          0.702    
Dependent Variable:        isolation_ii          AIC:                     2938.0828
Date:                      2015-09-23 11:02      BIC:                     3066.6791
No. Observations:          1039                  Log-Likelihood:          -1443.0  
Df Model:                  25                    F-statistic:             98.70    
Df Residuals:              1013                  Prob (F-statistic):      6.58e-251
R-squared:                 0.709                 Scale:                   0.96581  
-----------------------------------------------------------------------------------
                                  Coef.   Std.Err.    t    P>|t|   [0.025   0.975] 
-----------------------------------------------------------------------------------
tau                                7.1544   1.2477  5.7343 0.0000   4.7061   9.6027
tau2                              20.9009   5.0652  4.1264 0.0000  10.9614  30.8403
tau3                             -35.2096   5.4992 -6.4027 0.0000 -46.0007 -24.4185
vacr                               0.0432   0.0614  0.7048 0.4811  -0.0772   0.1636
sprawl                             0.2366   0.0620  3.8189 0.0001   0.1150   0.3582
gim__0.2_0.2_0.2_0.2_0.2|g0-0.20   2.5807   0.1536 16.8070 0.0000   2.2794   2.8820
gim__0.2_0.2_0.2_0.2_0.2|g1-0.20   2.5822   0.1536 16.8166 0.0000   2.2809   2.8835
gim__0.2_0.2_0.2_0.2_0.2|g2-0.20   2.5820   0.1536 16.8154 0.0000   2.2807   2.8833
gim__0.2_0.2_0.2_0.2_0.2|g3-0.20   2.5841   0.1536 16.8291 0.0000   2.2828   2.8854
gim__0.2_0.2_0.2_0.2_0.2|g4-0.20   2.5815   0.1536 16.8124 0.0000   2.2802   2.8829
gim__0.4_0.3_0.2_0.1|g0-0.40       1.2671   0.2008  6.3115 0.0000   0.8731   1.6611
gim__0.4_0.3_0.2_0.1|g1-0.30       1.3574   0.2008  6.7611 0.0000   0.9634   1.7513
gim__0.4_0.3_0.2_0.1|g2-0.20       1.6945   0.2008  8.4402 0.0000   1.3005   2.0885
gim__0.4_0.3_0.2_0.1|g3-0.10       3.2621   0.2008 16.2484 0.0000   2.8681   3.6560
gim__0.4_0.4_0.1_0.1|g0-0.40       1.6252   0.2263  7.1825 0.0000   1.1812   2.0692
gim__0.4_0.4_0.1_0.1|g1-0.40       1.6249   0.2263  7.1814 0.0000   1.1809   2.0689
gim__0.4_0.4_0.1_0.1|g2-0.10       2.6105   0.2263 11.5371 0.0000   2.1665   3.0545
gim__0.4_0.4_0.1_0.1|g3-0.10       2.5985   0.2263 11.4840 0.0000   2.1545   3.0425
Intercept                         -1.2615   0.1344 -9.3843 0.0000  -1.5253  -0.9977
gim__0.5_0.5|g1-0.50              -0.0000   0.1296 -0.0000 1.0000  -0.2543   0.2543
gim__0.7_0.1_0.1_0.1|g0-0.70       1.5837   0.2164  7.3172 0.0000   1.1590   2.0085
gim__0.7_0.1_0.1_0.1|g1-0.10       2.9086   0.2164 13.4383 0.0000   2.4839   3.3333
gim__0.7_0.1_0.1_0.1|g2-0.10       2.8985   0.2164 13.3917 0.0000   2.4738   3.3233
gim__0.7_0.1_0.1_0.1|g3-0.10       2.9468   0.2164 13.6149 0.0000   2.5221   3.3716
gim__0.7_0.3|g0-0.70               0.7547   0.1708  4.4184 0.0000   0.4195   1.0899
gim__0.7_0.3|g1-0.30               0.8667   0.1708  5.0741 0.0000   0.5315   1.2019
-----------------------------------------------------------------------------------
Omnibus:                    75.478             Durbin-Watson:                0.171 
Prob(Omnibus):              0.000              Jarque-Bera (JB):             47.674
Skew:                       0.396              Prob(JB):                     0.000 
Kurtosis:                   2.312              Condition No.:                328   
===================================================================================


#############################
theil_th
#############################
                    Results: Ordinary least squares
=======================================================================
Model:                 OLS               Adj. R-squared:      0.789    
Dependent Variable:    theil_th          AIC:                 -194.3606
Date:                  2015-09-23 11:02  BIC:                 -152.7048
No. Observations:      326               Log-Likelihood:      108.18   
Df Model:              10                F-statistic:         122.3    
Df Residuals:          315               Prob (F-statistic):  3.82e-102
R-squared:             0.795             Scale:               0.031203 
-----------------------------------------------------------------------
                         Coef.  Std.Err.    t    P>|t|   [0.025  0.975]
-----------------------------------------------------------------------
tau                      0.3670   0.3987  0.9205 0.3580 -0.4174  1.1514
tau2                     5.1663   1.5691  3.2925 0.0011  2.0790  8.2536
tau3                    -4.1045   1.6560 -2.4785 0.0137 -7.3628 -0.8462
vacr                     0.0103   0.0197  0.5217 0.6022 -0.0284  0.0490
sprawl                   0.0579   0.0198  2.9274 0.0037  0.0190  0.0968
pm__0.2_0.2_0.2_0.2_0.2  0.4644   0.0287 16.1862 0.0000  0.4079  0.5209
pm__0.4_0.3_0.2_0.1      0.2663   0.0385  6.9136 0.0000  0.1905  0.3421
pm__0.4_0.4_0.1_0.1      0.2862   0.0435  6.5864 0.0000  0.2007  0.3717
Intercept               -0.2729   0.0353 -7.7283 0.0000 -0.3424 -0.2034
pm__0.7_0.1_0.1_0.1      0.3931   0.0416  9.4479 0.0000  0.3112  0.4749
pm__0.7_0.3              0.1202   0.0326  3.6868 0.0003  0.0560  0.1843
-----------------------------------------------------------------------
Omnibus:                 1.189          Durbin-Watson:            0.751
Prob(Omnibus):           0.552          Jarque-Bera (JB):         1.159
Skew:                    -0.021         Prob(JB):                 0.560
Kurtosis:                2.711          Condition No.:            316  
=======================================================================


#############################
ellison_glaeser_egg_pop
#############################
                         Results: Ordinary least squares
=================================================================================
Model:                 OLS                       Adj. R-squared:       0.423     
Dependent Variable:    ellison_glaeser_egg_pop   AIC:                  -4101.3227
Date:                  2015-09-23 11:02          BIC:                  -3972.7263
No. Observations:      1039                      Log-Likelihood:       2076.7    
Df Model:              25                        F-statistic:          31.42     
Df Residuals:          1013                      Prob (F-statistic):   4.29e-108 
R-squared:             0.437                     Scale:                0.0011027 
---------------------------------------------------------------------------------
                                  Coef.  Std.Err.    t     P>|t|   [0.025  0.975]
---------------------------------------------------------------------------------
tau                               0.2699   0.0422   6.4031 0.0000  0.1872  0.3527
tau2                             -0.1691   0.1712  -0.9880 0.3234 -0.5050  0.1668
tau3                             -0.1461   0.1858  -0.7860 0.4320 -0.5107  0.2186
vacr                              0.0017   0.0021   0.8298 0.4069 -0.0023  0.0058
sprawl                           -0.0263   0.0021 -12.5473 0.0000 -0.0304 -0.0222
gim__0.2_0.2_0.2_0.2_0.2|g0-0.20  0.0471   0.0052   9.0770 0.0000  0.0369  0.0573
gim__0.2_0.2_0.2_0.2_0.2|g1-0.20  0.0471   0.0052   9.0842 0.0000  0.0370  0.0573
gim__0.2_0.2_0.2_0.2_0.2|g2-0.20  0.0471   0.0052   9.0844 0.0000  0.0370  0.0573
gim__0.2_0.2_0.2_0.2_0.2|g3-0.20  0.0472   0.0052   9.0889 0.0000  0.0370  0.0573
gim__0.2_0.2_0.2_0.2_0.2|g4-0.20  0.0471   0.0052   9.0759 0.0000  0.0369  0.0573
gim__0.4_0.3_0.2_0.1|g0-0.40      0.0231   0.0068   3.3996 0.0007  0.0098  0.0364
gim__0.4_0.3_0.2_0.1|g1-0.30      0.0238   0.0068   3.5031 0.0005  0.0105  0.0371
gim__0.4_0.3_0.2_0.1|g2-0.20      0.0281   0.0068   4.1447 0.0000  0.0148  0.0414
gim__0.4_0.3_0.2_0.1|g3-0.10      0.0611   0.0068   9.0120 0.0000  0.0478  0.0744
gim__0.4_0.4_0.1_0.1|g0-0.40      0.0291   0.0076   3.8048 0.0002  0.0141  0.0441
gim__0.4_0.4_0.1_0.1|g1-0.40      0.0291   0.0076   3.8049 0.0002  0.0141  0.0441
gim__0.4_0.4_0.1_0.1|g2-0.10      0.0483   0.0076   6.3185 0.0000  0.0333  0.0633
gim__0.4_0.4_0.1_0.1|g3-0.10      0.0477   0.0076   6.2448 0.0000  0.0327  0.0627
Intercept                        -0.0323   0.0045  -7.1182 0.0000 -0.0412 -0.0234
gim__0.5_0.5|g1-0.50             -0.0000   0.0044  -0.0000 1.0000 -0.0086  0.0086
gim__0.7_0.1_0.1_0.1|g0-0.70      0.0275   0.0073   3.7636 0.0002  0.0132  0.0419
gim__0.7_0.1_0.1_0.1|g1-0.10      0.0560   0.0073   7.6602 0.0000  0.0417  0.0704
gim__0.7_0.1_0.1_0.1|g2-0.10      0.0557   0.0073   7.6218 0.0000  0.0414  0.0701
gim__0.7_0.1_0.1_0.1|g3-0.10      0.0565   0.0073   7.7300 0.0000  0.0422  0.0709
gim__0.7_0.3|g0-0.70              0.0106   0.0058   1.8331 0.0671 -0.0007  0.0219
gim__0.7_0.3|g1-0.30              0.0122   0.0058   2.1106 0.0351  0.0009  0.0235
---------------------------------------------------------------------------------
Omnibus:                   365.331           Durbin-Watson:              1.953   
Prob(Omnibus):             0.000             Jarque-Bera (JB):           1103.974
Skew:                      1.778             Prob(JB):                   0.000   
Kurtosis:                  6.586             Condition No.:              328     
=================================================================================


#############################
segregation_gsg
#############################
                         Results: Ordinary least squares
=================================================================================
Model:                   OLS                   Adj. R-squared:          0.768    
Dependent Variable:      segregation_gsg       AIC:                     -601.3000
Date:                    2015-09-23 11:02      BIC:                     -472.7036
No. Observations:        1039                  Log-Likelihood:          326.65   
Df Model:                25                    F-statistic:             138.3    
Df Residuals:            1013                  Prob (F-statistic):      1.70e-305
R-squared:               0.773                 Scale:                   0.032023 
---------------------------------------------------------------------------------
                                  Coef.  Std.Err.    t     P>|t|   [0.025  0.975]
---------------------------------------------------------------------------------
tau                               2.2039   0.2272   9.7011 0.0000  1.7581  2.6497
tau2                             -0.0524   0.9223  -0.0568 0.9547 -1.8622  1.7575
tau3                             -0.3259   1.0013  -0.3254 0.7449 -2.2908  1.6390
vacr                              0.0126   0.0112   1.1236 0.2615 -0.0094  0.0345
sprawl                            0.0863   0.0113   7.6517 0.0000  0.0642  0.1085
gim__0.2_0.2_0.2_0.2_0.2|g0-0.20  0.4495   0.0280  16.0768 0.0000  0.3946  0.5044
gim__0.2_0.2_0.2_0.2_0.2|g1-0.20  0.4497   0.0280  16.0839 0.0000  0.3948  0.5046
gim__0.2_0.2_0.2_0.2_0.2|g2-0.20  0.4496   0.0280  16.0808 0.0000  0.3947  0.5045
gim__0.2_0.2_0.2_0.2_0.2|g3-0.20  0.4499   0.0280  16.0915 0.0000  0.3950  0.5048
gim__0.2_0.2_0.2_0.2_0.2|g4-0.20  0.4496   0.0280  16.0793 0.0000  0.3947  0.5044
gim__0.4_0.3_0.2_0.1|g0-0.40      0.2190   0.0366   5.9919 0.0000  0.1473  0.2908
gim__0.4_0.3_0.2_0.1|g1-0.30      0.2529   0.0366   6.9169 0.0000  0.1811  0.3246
gim__0.4_0.3_0.2_0.1|g2-0.20      0.3575   0.0366   9.7786 0.0000  0.2857  0.4292
gim__0.4_0.3_0.2_0.1|g3-0.10      0.6071   0.0366  16.6079 0.0000  0.5354  0.6789
gim__0.4_0.4_0.1_0.1|g0-0.40      0.2908   0.0412   7.0569 0.0000  0.2099  0.3716
gim__0.4_0.4_0.1_0.1|g1-0.40      0.2907   0.0412   7.0554 0.0000  0.2098  0.3715
gim__0.4_0.4_0.1_0.1|g2-0.10      0.5625   0.0412  13.6535 0.0000  0.4817  0.6434
gim__0.4_0.4_0.1_0.1|g3-0.10      0.5612   0.0412  13.6216 0.0000  0.4804  0.6421
Intercept                        -0.3538   0.0245 -14.4549 0.0000 -0.4019 -0.3058
gim__0.5_0.5|g1-0.50             -0.0000   0.0236  -0.0000 1.0000 -0.0463  0.0463
gim__0.7_0.1_0.1_0.1|g0-0.70      0.3778   0.0394   9.5864 0.0000  0.3005  0.4552
gim__0.7_0.1_0.1_0.1|g1-0.10      0.5960   0.0394  15.1226 0.0000  0.5187  0.6733
gim__0.7_0.1_0.1_0.1|g2-0.10      0.5955   0.0394  15.1110 0.0000  0.5182  0.6729
gim__0.7_0.1_0.1_0.1|g3-0.10      0.5980   0.0394  15.1729 0.0000  0.5207  0.6753
gim__0.7_0.3|g0-0.70              0.1567   0.0311   5.0390 0.0000  0.0957  0.2178
gim__0.7_0.3|g1-0.30              0.1567   0.0311   5.0390 0.0000  0.0957  0.2178
---------------------------------------------------------------------------------
Omnibus:                    44.591            Durbin-Watson:               0.291 
Prob(Omnibus):              0.000             Jarque-Bera (JB):            19.762
Skew:                       0.069             Prob(JB):                    0.000 
Kurtosis:                   2.339             Condition No.:               328   
=================================================================================


  • Individual approach

In this case, we include every single observation in the regression, instead of the average value of the run. This should take care of some of the variance issues and give more accurate results.

In [20]:
%%time
db['tau2'] = db['tau']**2
db['tau3'] = db['tau']**3
db.loc[db['vacr']==0.15, 'vacr'] = 0
db.loc[db['vacr']==0.25, 'vacr'] = 1

rsai = {}

xsi = ['tau', 'tau2', 'tau3', 'vacr', 'sprawl']
xdi = pd.get_dummies(db['group_in_mix'], prefix='gim_')
xdi = xdi.rename(columns={'gim__0.5_0.5|g0-0.50': 'Intercept'})
xdi['Intercept'] = 1
xi = db[xsi].join(xdi)

for y in name_y:
    ols = sm.OLS(db[y], xi).fit()
    rsai[y] = ols

# Theil
dbT = db.groupby(['tau', 'prop_mix', 'vacr', 'sprawl', 'rep_id'])\
             .first()\
             .reset_index()
xdti = pd.get_dummies(dbT['prop_mix'], prefix='pm_')
xdti = xdti.rename(columns={'pm__0.5_0.5': 'Intercept'})
xdti['Intercept'] = 1
xti = dbT[xsi].join(xdti)
ols = sm.OLS(dbT['theil_th'], xti).fit()
rsai['theil_th'] = ols
CPU times: user 3.56 s, sys: 180 ms, total: 3.74 s
Wall time: 3.71 s

Models

In [21]:
def starify(p):
    if p < 0.001:
        return '***'
    elif 0.01 <= p < 0.05:
        return '**'
    elif 0.05 <= p < 0.1:
        return '*'
    else:
        return ''
tablei = {}
for model in rsai:
    tablei[(model, 'beta')] = pd.np.round(rsai[model].params, 4)
    tablei[(model, 'sig')] = rsai[model].pvalues.apply(starify)
    tablei[(model, 'beta')] = pd.concat([tablei[(model, 'beta')], \
                                         pd.Series(rsai[model].nobs, index=['N'])])
tablei = pd.DataFrame(tablei)
orderi = ['tau', 'tau2', 'tau3', 'vacr', 'sprawl', 'Intercept'] \
         + [i for i in tablei.index if 'm_' in i] + ['N']
final_tabi = tablei.reindex(orderi).fillna('')
final_tabi
Out[21]:
ellison_glaeser_egg_pop isolation_ii segregation_gsg theil_th
beta sig beta sig beta sig beta sig
tau 0.182 *** 5.0037 *** 1.6917 *** -0.0626 ***
tau2 0.067 *** 27.0463 *** 1.543 *** 6.4639 ***
tau3 -0.3296 *** -40.2671 *** -1.6814 *** -5.1957 ***
vacr 0.0041 *** 0.0845 *** 0.0201 *** 0.0152 ***
sprawl -0.0194 *** 0.3193 *** 0.107 *** 0.0699 ***
Intercept -0.0294 *** -1.1476 *** -0.3343 *** -0.2503 ***
gim__0.2_0.2_0.2_0.2_0.2|g0-0.20 0.0419 *** 2.4817 *** 0.4389 ***
gim__0.2_0.2_0.2_0.2_0.2|g1-0.20 0.0419 *** 2.4828 *** 0.4391 ***
gim__0.2_0.2_0.2_0.2_0.2|g2-0.20 0.0419 *** 2.4829 *** 0.4391 ***
gim__0.2_0.2_0.2_0.2_0.2|g3-0.20 0.0419 *** 2.4841 *** 0.4393 ***
gim__0.2_0.2_0.2_0.2_0.2|g4-0.20 0.0419 *** 2.483 *** 0.439 ***
gim__0.4_0.3_0.2_0.1|g0-0.40 0.0263 *** 1.5306 *** 0.2658 ***
gim__0.4_0.3_0.2_0.1|g1-0.30 0.0264 *** 1.5539 *** 0.2724 ***
gim__0.4_0.3_0.2_0.1|g2-0.20 0.0271 *** 1.6561 *** 0.314 ***
gim__0.4_0.3_0.2_0.1|g3-0.10 0.0397 *** 2.4703 *** 0.5272 ***
gim__0.4_0.4_0.1_0.1|g0-0.40 0.0271 *** 1.5941 *** 0.2844 ***
gim__0.4_0.4_0.1_0.1|g1-0.40 0.027 *** 1.5937 *** 0.284 ***
gim__0.4_0.4_0.1_0.1|g2-0.10 0.039 *** 2.3795 *** 0.5198 ***
gim__0.4_0.4_0.1_0.1|g3-0.10 0.039 *** 2.378 *** 0.5194 ***
gim__0.5_0.5|g1-0.50 -0 -0 -0
gim__0.7_0.1_0.1_0.1|g0-0.70 0.0266 *** 1.59 *** 0.3495 ***
gim__0.7_0.1_0.1_0.1|g1-0.10 0.0421 *** 2.5206 *** 0.5398 ***
gim__0.7_0.1_0.1_0.1|g2-0.10 0.042 *** 2.5207 *** 0.5397 ***
gim__0.7_0.1_0.1_0.1|g3-0.10 0.0422 *** 2.5244 *** 0.5405 ***
gim__0.7_0.3|g0-0.70 0.0117 *** 0.8254 *** 0.1572 ***
gim__0.7_0.3|g1-0.30 0.0126 *** 0.9119 *** 0.1572 ***
pm__0.2_0.2_0.2_0.2_0.2 0.448 ***
pm__0.4_0.3_0.2_0.1 0.2375 ***
pm__0.4_0.4_0.1_0.1 0.2647 ***
pm__0.7_0.1_0.1_0.1 0.3434 ***
pm__0.7_0.3 0.1233 ***
N 468688 468688 468688 150103

Main Effect Plots

In [22]:
f, axs = plt.subplots(1, 4, figsize=(12, 3))
axs = axs.ravel()

for y, ax in zip(name_y, axs):
    betas = rsai[y].params
    ax = tools.main_effect_plot(y, 'tau', betas, \
                                xi.join(db[y]), ax=ax)
    ax.set_title(y)

y = 'theil_th'
betas = rsai[y].params
ax = tools.main_effect_plot(y, 'tau', betas, \
                            xti.join(dbT[y]), ax=axs[-1])
ax.set_title(y)
plt.tight_layout()

plt.show()

Full tables

In [23]:
for model in rsai:
    print '\n#############################'
    print model
    print '#############################'
    print rsa[model].summary2()

#############################
isolation_ii
#############################
                          Results: Ordinary least squares
===================================================================================
Model:                     OLS                   Adj. R-squared:          0.702    
Dependent Variable:        isolation_ii          AIC:                     2938.0828
Date:                      2015-09-23 11:02      BIC:                     3066.6791
No. Observations:          1039                  Log-Likelihood:          -1443.0  
Df Model:                  25                    F-statistic:             98.70    
Df Residuals:              1013                  Prob (F-statistic):      6.58e-251
R-squared:                 0.709                 Scale:                   0.96581  
-----------------------------------------------------------------------------------
                                  Coef.   Std.Err.    t    P>|t|   [0.025   0.975] 
-----------------------------------------------------------------------------------
tau                                7.1544   1.2477  5.7343 0.0000   4.7061   9.6027
tau2                              20.9009   5.0652  4.1264 0.0000  10.9614  30.8403
tau3                             -35.2096   5.4992 -6.4027 0.0000 -46.0007 -24.4185
vacr                               0.0432   0.0614  0.7048 0.4811  -0.0772   0.1636
sprawl                             0.2366   0.0620  3.8189 0.0001   0.1150   0.3582
gim__0.2_0.2_0.2_0.2_0.2|g0-0.20   2.5807   0.1536 16.8070 0.0000   2.2794   2.8820
gim__0.2_0.2_0.2_0.2_0.2|g1-0.20   2.5822   0.1536 16.8166 0.0000   2.2809   2.8835
gim__0.2_0.2_0.2_0.2_0.2|g2-0.20   2.5820   0.1536 16.8154 0.0000   2.2807   2.8833
gim__0.2_0.2_0.2_0.2_0.2|g3-0.20   2.5841   0.1536 16.8291 0.0000   2.2828   2.8854
gim__0.2_0.2_0.2_0.2_0.2|g4-0.20   2.5815   0.1536 16.8124 0.0000   2.2802   2.8829
gim__0.4_0.3_0.2_0.1|g0-0.40       1.2671   0.2008  6.3115 0.0000   0.8731   1.6611
gim__0.4_0.3_0.2_0.1|g1-0.30       1.3574   0.2008  6.7611 0.0000   0.9634   1.7513
gim__0.4_0.3_0.2_0.1|g2-0.20       1.6945   0.2008  8.4402 0.0000   1.3005   2.0885
gim__0.4_0.3_0.2_0.1|g3-0.10       3.2621   0.2008 16.2484 0.0000   2.8681   3.6560
gim__0.4_0.4_0.1_0.1|g0-0.40       1.6252   0.2263  7.1825 0.0000   1.1812   2.0692
gim__0.4_0.4_0.1_0.1|g1-0.40       1.6249   0.2263  7.1814 0.0000   1.1809   2.0689
gim__0.4_0.4_0.1_0.1|g2-0.10       2.6105   0.2263 11.5371 0.0000   2.1665   3.0545
gim__0.4_0.4_0.1_0.1|g3-0.10       2.5985   0.2263 11.4840 0.0000   2.1545   3.0425
Intercept                         -1.2615   0.1344 -9.3843 0.0000  -1.5253  -0.9977
gim__0.5_0.5|g1-0.50              -0.0000   0.1296 -0.0000 1.0000  -0.2543   0.2543
gim__0.7_0.1_0.1_0.1|g0-0.70       1.5837   0.2164  7.3172 0.0000   1.1590   2.0085
gim__0.7_0.1_0.1_0.1|g1-0.10       2.9086   0.2164 13.4383 0.0000   2.4839   3.3333
gim__0.7_0.1_0.1_0.1|g2-0.10       2.8985   0.2164 13.3917 0.0000   2.4738   3.3233
gim__0.7_0.1_0.1_0.1|g3-0.10       2.9468   0.2164 13.6149 0.0000   2.5221   3.3716
gim__0.7_0.3|g0-0.70               0.7547   0.1708  4.4184 0.0000   0.4195   1.0899
gim__0.7_0.3|g1-0.30               0.8667   0.1708  5.0741 0.0000   0.5315   1.2019
-----------------------------------------------------------------------------------
Omnibus:                    75.478             Durbin-Watson:                0.171 
Prob(Omnibus):              0.000              Jarque-Bera (JB):             47.674
Skew:                       0.396              Prob(JB):                     0.000 
Kurtosis:                   2.312              Condition No.:                328   
===================================================================================


#############################
theil_th
#############################
                    Results: Ordinary least squares
=======================================================================
Model:                 OLS               Adj. R-squared:      0.789    
Dependent Variable:    theil_th          AIC:                 -194.3606
Date:                  2015-09-23 11:02  BIC:                 -152.7048
No. Observations:      326               Log-Likelihood:      108.18   
Df Model:              10                F-statistic:         122.3    
Df Residuals:          315               Prob (F-statistic):  3.82e-102
R-squared:             0.795             Scale:               0.031203 
-----------------------------------------------------------------------
                         Coef.  Std.Err.    t    P>|t|   [0.025  0.975]
-----------------------------------------------------------------------
tau                      0.3670   0.3987  0.9205 0.3580 -0.4174  1.1514
tau2                     5.1663   1.5691  3.2925 0.0011  2.0790  8.2536
tau3                    -4.1045   1.6560 -2.4785 0.0137 -7.3628 -0.8462
vacr                     0.0103   0.0197  0.5217 0.6022 -0.0284  0.0490
sprawl                   0.0579   0.0198  2.9274 0.0037  0.0190  0.0968
pm__0.2_0.2_0.2_0.2_0.2  0.4644   0.0287 16.1862 0.0000  0.4079  0.5209
pm__0.4_0.3_0.2_0.1      0.2663   0.0385  6.9136 0.0000  0.1905  0.3421
pm__0.4_0.4_0.1_0.1      0.2862   0.0435  6.5864 0.0000  0.2007  0.3717
Intercept               -0.2729   0.0353 -7.7283 0.0000 -0.3424 -0.2034
pm__0.7_0.1_0.1_0.1      0.3931   0.0416  9.4479 0.0000  0.3112  0.4749
pm__0.7_0.3              0.1202   0.0326  3.6868 0.0003  0.0560  0.1843
-----------------------------------------------------------------------
Omnibus:                 1.189          Durbin-Watson:            0.751
Prob(Omnibus):           0.552          Jarque-Bera (JB):         1.159
Skew:                    -0.021         Prob(JB):                 0.560
Kurtosis:                2.711          Condition No.:            316  
=======================================================================


#############################
ellison_glaeser_egg_pop
#############################
                         Results: Ordinary least squares
=================================================================================
Model:                 OLS                       Adj. R-squared:       0.423     
Dependent Variable:    ellison_glaeser_egg_pop   AIC:                  -4101.3227
Date:                  2015-09-23 11:02          BIC:                  -3972.7263
No. Observations:      1039                      Log-Likelihood:       2076.7    
Df Model:              25                        F-statistic:          31.42     
Df Residuals:          1013                      Prob (F-statistic):   4.29e-108 
R-squared:             0.437                     Scale:                0.0011027 
---------------------------------------------------------------------------------
                                  Coef.  Std.Err.    t     P>|t|   [0.025  0.975]
---------------------------------------------------------------------------------
tau                               0.2699   0.0422   6.4031 0.0000  0.1872  0.3527
tau2                             -0.1691   0.1712  -0.9880 0.3234 -0.5050  0.1668
tau3                             -0.1461   0.1858  -0.7860 0.4320 -0.5107  0.2186
vacr                              0.0017   0.0021   0.8298 0.4069 -0.0023  0.0058
sprawl                           -0.0263   0.0021 -12.5473 0.0000 -0.0304 -0.0222
gim__0.2_0.2_0.2_0.2_0.2|g0-0.20  0.0471   0.0052   9.0770 0.0000  0.0369  0.0573
gim__0.2_0.2_0.2_0.2_0.2|g1-0.20  0.0471   0.0052   9.0842 0.0000  0.0370  0.0573
gim__0.2_0.2_0.2_0.2_0.2|g2-0.20  0.0471   0.0052   9.0844 0.0000  0.0370  0.0573
gim__0.2_0.2_0.2_0.2_0.2|g3-0.20  0.0472   0.0052   9.0889 0.0000  0.0370  0.0573
gim__0.2_0.2_0.2_0.2_0.2|g4-0.20  0.0471   0.0052   9.0759 0.0000  0.0369  0.0573
gim__0.4_0.3_0.2_0.1|g0-0.40      0.0231   0.0068   3.3996 0.0007  0.0098  0.0364
gim__0.4_0.3_0.2_0.1|g1-0.30      0.0238   0.0068   3.5031 0.0005  0.0105  0.0371
gim__0.4_0.3_0.2_0.1|g2-0.20      0.0281   0.0068   4.1447 0.0000  0.0148  0.0414
gim__0.4_0.3_0.2_0.1|g3-0.10      0.0611   0.0068   9.0120 0.0000  0.0478  0.0744
gim__0.4_0.4_0.1_0.1|g0-0.40      0.0291   0.0076   3.8048 0.0002  0.0141  0.0441
gim__0.4_0.4_0.1_0.1|g1-0.40      0.0291   0.0076   3.8049 0.0002  0.0141  0.0441
gim__0.4_0.4_0.1_0.1|g2-0.10      0.0483   0.0076   6.3185 0.0000  0.0333  0.0633
gim__0.4_0.4_0.1_0.1|g3-0.10      0.0477   0.0076   6.2448 0.0000  0.0327  0.0627
Intercept                        -0.0323   0.0045  -7.1182 0.0000 -0.0412 -0.0234
gim__0.5_0.5|g1-0.50             -0.0000   0.0044  -0.0000 1.0000 -0.0086  0.0086
gim__0.7_0.1_0.1_0.1|g0-0.70      0.0275   0.0073   3.7636 0.0002  0.0132  0.0419
gim__0.7_0.1_0.1_0.1|g1-0.10      0.0560   0.0073   7.6602 0.0000  0.0417  0.0704
gim__0.7_0.1_0.1_0.1|g2-0.10      0.0557   0.0073   7.6218 0.0000  0.0414  0.0701
gim__0.7_0.1_0.1_0.1|g3-0.10      0.0565   0.0073   7.7300 0.0000  0.0422  0.0709
gim__0.7_0.3|g0-0.70              0.0106   0.0058   1.8331 0.0671 -0.0007  0.0219
gim__0.7_0.3|g1-0.30              0.0122   0.0058   2.1106 0.0351  0.0009  0.0235
---------------------------------------------------------------------------------
Omnibus:                   365.331           Durbin-Watson:              1.953   
Prob(Omnibus):             0.000             Jarque-Bera (JB):           1103.974
Skew:                      1.778             Prob(JB):                   0.000   
Kurtosis:                  6.586             Condition No.:              328     
=================================================================================


#############################
segregation_gsg
#############################
                         Results: Ordinary least squares
=================================================================================
Model:                   OLS                   Adj. R-squared:          0.768    
Dependent Variable:      segregation_gsg       AIC:                     -601.3000
Date:                    2015-09-23 11:02      BIC:                     -472.7036
No. Observations:        1039                  Log-Likelihood:          326.65   
Df Model:                25                    F-statistic:             138.3    
Df Residuals:            1013                  Prob (F-statistic):      1.70e-305
R-squared:               0.773                 Scale:                   0.032023 
---------------------------------------------------------------------------------
                                  Coef.  Std.Err.    t     P>|t|   [0.025  0.975]
---------------------------------------------------------------------------------
tau                               2.2039   0.2272   9.7011 0.0000  1.7581  2.6497
tau2                             -0.0524   0.9223  -0.0568 0.9547 -1.8622  1.7575
tau3                             -0.3259   1.0013  -0.3254 0.7449 -2.2908  1.6390
vacr                              0.0126   0.0112   1.1236 0.2615 -0.0094  0.0345
sprawl                            0.0863   0.0113   7.6517 0.0000  0.0642  0.1085
gim__0.2_0.2_0.2_0.2_0.2|g0-0.20  0.4495   0.0280  16.0768 0.0000  0.3946  0.5044
gim__0.2_0.2_0.2_0.2_0.2|g1-0.20  0.4497   0.0280  16.0839 0.0000  0.3948  0.5046
gim__0.2_0.2_0.2_0.2_0.2|g2-0.20  0.4496   0.0280  16.0808 0.0000  0.3947  0.5045
gim__0.2_0.2_0.2_0.2_0.2|g3-0.20  0.4499   0.0280  16.0915 0.0000  0.3950  0.5048
gim__0.2_0.2_0.2_0.2_0.2|g4-0.20  0.4496   0.0280  16.0793 0.0000  0.3947  0.5044
gim__0.4_0.3_0.2_0.1|g0-0.40      0.2190   0.0366   5.9919 0.0000  0.1473  0.2908
gim__0.4_0.3_0.2_0.1|g1-0.30      0.2529   0.0366   6.9169 0.0000  0.1811  0.3246
gim__0.4_0.3_0.2_0.1|g2-0.20      0.3575   0.0366   9.7786 0.0000  0.2857  0.4292
gim__0.4_0.3_0.2_0.1|g3-0.10      0.6071   0.0366  16.6079 0.0000  0.5354  0.6789
gim__0.4_0.4_0.1_0.1|g0-0.40      0.2908   0.0412   7.0569 0.0000  0.2099  0.3716
gim__0.4_0.4_0.1_0.1|g1-0.40      0.2907   0.0412   7.0554 0.0000  0.2098  0.3715
gim__0.4_0.4_0.1_0.1|g2-0.10      0.5625   0.0412  13.6535 0.0000  0.4817  0.6434
gim__0.4_0.4_0.1_0.1|g3-0.10      0.5612   0.0412  13.6216 0.0000  0.4804  0.6421
Intercept                        -0.3538   0.0245 -14.4549 0.0000 -0.4019 -0.3058
gim__0.5_0.5|g1-0.50             -0.0000   0.0236  -0.0000 1.0000 -0.0463  0.0463
gim__0.7_0.1_0.1_0.1|g0-0.70      0.3778   0.0394   9.5864 0.0000  0.3005  0.4552
gim__0.7_0.1_0.1_0.1|g1-0.10      0.5960   0.0394  15.1226 0.0000  0.5187  0.6733
gim__0.7_0.1_0.1_0.1|g2-0.10      0.5955   0.0394  15.1110 0.0000  0.5182  0.6729
gim__0.7_0.1_0.1_0.1|g3-0.10      0.5980   0.0394  15.1729 0.0000  0.5207  0.6753
gim__0.7_0.3|g0-0.70              0.1567   0.0311   5.0390 0.0000  0.0957  0.2178
gim__0.7_0.3|g1-0.30              0.1567   0.0311   5.0390 0.0000  0.0957  0.2178
---------------------------------------------------------------------------------
Omnibus:                    44.591            Durbin-Watson:               0.291 
Prob(Omnibus):              0.000             Jarque-Bera (JB):            19.762
Skew:                       0.069             Prob(JB):                    0.000 
Kurtosis:                   2.339             Condition No.:               328   
=================================================================================