6. Analyzing RCT reemployment experiment#
6.1. Analyzing RCT data with Precision Adjustment#
6.2. Data#
In this lab, we analyze the Pennsylvania re-employment bonus experiment, which was previously studied in “Sequential testing of duration data: the case of the Pennsylvania ‘reemployment bonus’ experiment” (Bilias, 2000), among others. These experiments were conducted in the 1980s by the U.S. Department of Labor to test the incentive effects of alternative compensation schemes for unemployment insurance (UI). In these experiments, UI claimants were randomly assigned either to a control group or one of five treatment groups. Actually, there are six treatment groups in the experiments. Here we focus on treatment group 4, but feel free to explore other treatment groups. In the control group the current rules of the UI applied. Individuals in the treatment groups were offered a cash bonus if they found a job within some pre-specified period of time (qualification period), provided that the job was retained for a specified duration. The treatments differed in the level of the bonus, the length of the qualification period, and whether the bonus was declining over time in the qualification period; see http://qed.econ.queensu.ca/jae/2000-v15.6/bilias/readme.b.txt for further details on data.
import pandas as pd
import pyreadr
import os
from urllib.request import urlopen
## loading the data
Penn = pd.read_csv("https://raw.githubusercontent.com/d2cml-ai/14.388_py/main/data/penn_jae.dat" , sep='\s', engine='python')
n = Penn.shape[0]
p_1 = Penn.shape[1]
Penn = Penn[ (Penn['tg'] == 4) | (Penn['tg'] == 0) ]
Penn.shape
(5099, 24)
# Dependent variable
Penn['T4'] = (Penn[['tg']]==4).astype(int)
# Create category variable
Penn['dep'] = Penn['dep'].astype( 'category' )
Penn.head()
abdt | tg | inuidur1 | inuidur2 | female | black | hispanic | othrace | dep | q1 | ... | q6 | recall | agelt35 | agegt54 | durable | nondurable | lusd | husd | muld | T4 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 10824 | 0 | 18 | 18 | 0 | 0 | 0 | 0 | 2 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | NaN | 0 |
3 | 10824 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | NaN | 0 |
4 | 10747 | 0 | 27 | 27 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | NaN | 0 |
11 | 10607 | 4 | 9 | 9 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | NaN | 1 |
12 | 10831 | 0 | 27 | 27 | 0 | 0 | 0 | 0 | 1 | 0 | ... | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | NaN | 0 |
5 rows × 25 columns
Penn['dep'].unique()
[2, 0, 1]
Categories (3, int64): [0, 1, 2]
6.2.1. Model#
To evaluate the impact of the treatments on unemployment duration, we consider the linear regression model:
where \(Y\) is the log of duration of unemployment, \(D\) is a treatment indicators, and \(W\) is a set of controls including age group dummies, gender, race, number of dependents, quarter of the experiment, location within the state, existence of recall expectations, and type of occupation. Here \(\beta_1\) is the ATE, if the RCT assumptions hold rigorously.
We also consider interactive regression model:
where \(W\)’s are demeaned (apart from the intercept), so that \(\alpha_1\) is the ATE, if the RCT assumptions hold rigorously.
Under RCT, the projection coefficient \(\beta_1\) has the interpretation of the causal effect of the treatment on the average outcome. We thus refer to \(\beta_1\) as the average treatment effect (ATE). Note that the covariates, here are independent of the treatment \(D\), so we can identify \(\beta_1\) by just linear regression of \(Y\) on \(D\), without adding covariates. However we do add covariates in an effort to improve the precision of our estimates of the average treatment effect.
6.2.2. Analysis#
We consider
classical 2-sample approach, no adjustment (CL)
classical linear regression adjustment (CRA)
interactive regression adjusment (IRA)
and carry out robust inference using the estimatr R packages.
6.3. Carry out covariate balance check#
This is done using “lm_robust” command which unlike “lm” in the base command automatically does the correct Eicher-Huber-White standard errors, instead othe classical non-robus formula based on the homoscdedasticity command.
import statsmodels.api as sm
import statsmodels.formula.api as smf
import patsy
import numpy as np
Regress treatment on all covariates
I use data from R
y = Penn[['T4']].reset_index( drop = True )
# Get data from R
link="https://raw.githubusercontent.com/d2cml-ai/14.388_py/main/data/m_reg.RData"
response = urlopen(link)
content = response.read()
fhandle = open( 'm_reg.RData', 'wb')
fhandle.write(content)
fhandle.close()
result = pyreadr.read_r("m_reg.RData")
os.remove("m_reg.RData")
# Extracting the data frame from rdata_read
X_vars = result['X1']
# model = "T4~(female+black+othrace+C(dep)+q2+q3+q4+q5+q6+agelt35+agegt54+durable+lusd+husd)**2"
model_results = sm.OLS( y, X_vars ).fit().get_robustcov_results(cov_type = "HC1")
print(model_results.summary())
print( "Number of regressors in the basic model:",len(model_results.params), '\n')
OLS Regression Results
==============================================================================
Dep. Variable: T4 R-squared: 0.029
Model: OLS Adj. R-squared: 0.009
Method: Least Squares F-statistic: 29.07
Date: Thu, 04 Aug 2022 Prob (F-statistic): 0.00
Time: 22:20:49 Log-Likelihood: -3358.5
No. Observations: 5099 AIC: 6923.
Df Residuals: 4996 BIC: 7596.
Df Model: 102
Covariance Type: HC1
========================================================================================
coef std err t P>|t| [0.025 0.975]
----------------------------------------------------------------------------------------
(Intercept) 0.3215 0.161 1.993 0.046 0.005 0.638
female 0.1042 0.136 0.765 0.444 -0.163 0.371
black 0.0716 0.083 0.864 0.387 -0.091 0.234
othrace 0.0280 0.405 0.069 0.945 -0.766 0.822
factor(dep)1 -0.0736 0.201 -0.366 0.714 -0.468 0.320
factor(dep)2 -0.1085 0.158 -0.689 0.491 -0.417 0.200
q2 -0.0267 0.163 -0.164 0.870 -0.345 0.292
q3 -0.0057 0.162 -0.035 0.972 -0.324 0.312
q4 0.0433 0.162 0.267 0.789 -0.275 0.362
q5 0.0939 0.162 0.581 0.561 -0.223 0.411
q6 -0.2216 0.160 -1.386 0.166 -0.535 0.092
agelt35 -0.1092 0.133 -0.820 0.412 -0.370 0.152
agegt54 -0.4367 0.136 -3.215 0.001 -0.703 -0.170
durable -0.1250 0.171 -0.732 0.464 -0.460 0.210
lusd 0.1143 0.068 1.675 0.094 -0.019 0.248
husd 0.0947 0.074 1.286 0.199 -0.050 0.239
female:black 0.0889 0.044 2.028 0.043 0.003 0.175
female:othrace -0.4135 0.165 -2.509 0.012 -0.737 -0.090
female:factor(dep)1 0.0555 0.046 1.194 0.233 -0.036 0.147
female:factor(dep)2 0.0454 0.041 1.121 0.262 -0.034 0.125
female:q2 -0.1888 0.136 -1.390 0.165 -0.455 0.078
female:q3 -0.1653 0.136 -1.218 0.223 -0.431 0.101
female:q4 -0.1763 0.135 -1.303 0.193 -0.442 0.089
female:q5 -0.2032 0.135 -1.507 0.132 -0.468 0.061
female:q6 -0.0427 0.142 -0.300 0.764 -0.322 0.236
female:agelt35 0.0734 0.030 2.444 0.015 0.015 0.132
female:agegt54 0.0261 0.051 0.513 0.608 -0.074 0.126
female:durable 0.0198 0.044 0.452 0.651 -0.066 0.105
female:lusd 0.0021 0.034 0.061 0.951 -0.064 0.069
female:husd 0.0118 0.037 0.315 0.753 -0.062 0.085
black:factor(dep)1 -0.1173 0.068 -1.725 0.085 -0.251 0.016
black:factor(dep)2 -0.0222 0.063 -0.350 0.726 -0.147 0.102
black:q2 -0.0335 0.090 -0.373 0.709 -0.210 0.143
black:q3 -0.1966 0.085 -2.311 0.021 -0.363 -0.030
black:q4 -0.1249 0.086 -1.452 0.147 -0.294 0.044
black:q5 -0.2099 0.084 -2.499 0.012 -0.375 -0.045
black:agelt35 0.0623 0.045 1.380 0.168 -0.026 0.151
black:agegt54 0.0513 0.085 0.606 0.544 -0.114 0.217
black:durable 0.1048 0.066 1.583 0.113 -0.025 0.234
black:lusd -0.0210 0.056 -0.376 0.707 -0.131 0.089
black:husd 0.2496 0.169 1.479 0.139 -0.081 0.580
othrace:factor(dep)1 -0.8581 0.331 -2.594 0.010 -1.507 -0.210
othrace:factor(dep)2 0.2415 0.133 1.812 0.070 -0.020 0.503
othrace:q2 0.4372 0.347 1.261 0.207 -0.243 1.117
othrace:q3 -0.3734 0.377 -0.990 0.322 -1.113 0.366
othrace:q4 0.4159 0.330 1.262 0.207 -0.230 1.062
othrace:q5 0.0061 0.311 0.019 0.984 -0.604 0.616
othrace:agelt35 0.3165 0.183 1.725 0.085 -0.043 0.676
othrace:agegt54 0.3092 0.159 1.943 0.052 -0.003 0.621
othrace:durable -0.1908 0.138 -1.387 0.166 -0.460 0.079
othrace:lusd -0.0911 0.203 -0.450 0.653 -0.488 0.306
othrace:husd 0.0052 0.203 0.025 0.980 -0.393 0.403
factor(dep)1:q2 0.1658 0.201 0.825 0.409 -0.228 0.559
factor(dep)2:q2 0.0875 0.157 0.559 0.576 -0.220 0.395
factor(dep)1:q3 0.1210 0.200 0.606 0.545 -0.270 0.512
factor(dep)2:q3 0.1396 0.157 0.891 0.373 -0.168 0.447
factor(dep)1:q4 0.0848 0.199 0.426 0.670 -0.306 0.475
factor(dep)2:q4 0.0910 0.157 0.580 0.562 -0.217 0.399
factor(dep)1:q5 0.1105 0.198 0.557 0.578 -0.278 0.499
factor(dep)2:q5 0.0960 0.155 0.618 0.537 -0.209 0.401
factor(dep)1:q6 0.1007 0.209 0.482 0.630 -0.309 0.510
factor(dep)2:q6 0.0484 0.164 0.295 0.768 -0.273 0.370
factor(dep)1:agelt35 -0.0737 0.049 -1.518 0.129 -0.169 0.021
factor(dep)2:agelt35 -0.0244 0.038 -0.650 0.515 -0.098 0.049
factor(dep)1:agegt54 -0.0806 0.068 -1.180 0.238 -0.214 0.053
factor(dep)2:agegt54 0.0280 0.128 0.219 0.826 -0.222 0.279
factor(dep)1:durable -0.0603 0.060 -1.011 0.312 -0.177 0.057
factor(dep)2:durable 0.1247 0.050 2.481 0.013 0.026 0.223
factor(dep)1:lusd 0.0590 0.052 1.124 0.261 -0.044 0.162
factor(dep)2:lusd 0.0516 0.047 1.095 0.273 -0.041 0.144
factor(dep)1:husd -0.0433 0.056 -0.775 0.438 -0.153 0.066
factor(dep)2:husd -0.0882 0.048 -1.847 0.065 -0.182 0.005
q2:agelt35 0.1275 0.133 0.957 0.338 -0.134 0.389
q2:agegt54 0.5296 0.137 3.869 0.000 0.261 0.798
q2:durable 0.1261 0.170 0.744 0.457 -0.206 0.458
q2:lusd -0.0762 0.071 -1.070 0.285 -0.216 0.063
q2:husd -0.0188 0.075 -0.250 0.803 -0.167 0.129
q3:agelt35 0.1306 0.133 0.982 0.326 -0.130 0.391
q3:agegt54 0.4782 0.134 3.567 0.000 0.215 0.741
q3:durable 0.0542 0.169 0.320 0.749 -0.278 0.386
q3:lusd -0.0538 0.070 -0.770 0.442 -0.191 0.083
q3:husd -0.0601 0.075 -0.802 0.422 -0.207 0.087
q4:agelt35 0.1310 0.133 0.987 0.324 -0.129 0.391
q4:agegt54 0.5403 0.131 4.111 0.000 0.283 0.798
q4:durable 0.0963 0.170 0.567 0.571 -0.237 0.429
q4:lusd -0.1034 0.071 -1.466 0.143 -0.242 0.035
q4:husd -0.1719 0.075 -2.306 0.021 -0.318 -0.026
q5:agelt35 0.0708 0.132 0.536 0.592 -0.188 0.330
q5:agegt54 0.4438 0.131 3.399 0.001 0.188 0.700
q5:durable 0.0747 0.168 0.445 0.656 -0.254 0.403
q5:lusd -0.0761 0.070 -1.087 0.277 -0.213 0.061
q5:husd -0.1616 0.073 -2.213 0.027 -0.305 -0.018
q6:agelt35 0.1703 0.139 1.226 0.220 -0.102 0.443
q6:agegt54 0.5655 0.150 3.760 0.000 0.271 0.860
q6:durable 0.2558 0.178 1.434 0.152 -0.094 0.605
agelt35:durable 0.0095 0.041 0.234 0.815 -0.070 0.089
agelt35:lusd -0.0259 0.035 -0.730 0.465 -0.095 0.044
agelt35:husd 0.0355 0.040 0.893 0.372 -0.042 0.113
agegt54:durable -0.0623 0.064 -0.975 0.330 -0.188 0.063
agegt54:lusd -0.0366 0.058 -0.632 0.527 -0.150 0.077
agegt54:husd -0.0742 0.061 -1.212 0.226 -0.194 0.046
durable:lusd -0.0552 0.043 -1.271 0.204 -0.140 0.030
durable:husd -0.0002 0.053 -0.003 0.997 -0.104 0.103
==============================================================================
Omnibus: 34121.343 Durbin-Watson: 1.963
Prob(Omnibus): 0.000 Jarque-Bera (JB): 815.623
Skew: 0.643 Prob(JB): 7.76e-178
Kurtosis: 1.522 Cond. No. 177.
==============================================================================
Notes:
[1] Standard Errors are heteroscedasticity robust (HC1)
Number of regressors in the basic model: 103
We see that that even though this is a randomized experiment, balance conditions are failed.
6.4. Model Specification#
I use data from R.
# model specifications
# take log of inuidur1
Penn["log_inuidur1"] = np.log( Penn["inuidur1"] )
log_inuidur1 = pd.DataFrame(np.log( Penn["inuidur1"] ) ).reset_index( drop = True )
# no adjustment (2-sample approach)
formula_cl = 'log_inuidur1 ~ T4'
# adding controls
# formula_cra = 'log_inuidur1 ~ T4 + (female+black+othrace+dep+q2+q3+q4+q5+q6+agelt35+agegt54+durable+lusd+husd)**2'
# Omitted dummies: q1, nondurable, muld
ols_cl = smf.ols( formula = formula_cl, data = Penn ).fit().get_robustcov_results(cov_type = "HC1")
#getting data
# Get data from R
link="https://raw.githubusercontent.com/d2cml-ai/14.388_py/main/data/ols_cra_reg.RData"
response = urlopen(link)
content = response.read()
fhandle = open( 'ols_cra_reg.RData', 'wb')
fhandle.write(content)
fhandle.close()
result = pyreadr.read_r("ols_cra_reg.RData")
os.remove("ols_cra_reg.RData")
# Extracting the data frame from rdata_read
X_vars = result['X1']
ols_cra = sm.OLS( log_inuidur1, X_vars ).fit().get_robustcov_results(cov_type = "HC1")
# Results
print(ols_cl.summary())
print(ols_cra.summary())
OLS Regression Results
==============================================================================
Dep. Variable: log_inuidur1 R-squared: 0.001
Model: OLS Adj. R-squared: 0.001
Method: Least Squares F-statistic: 5.680
Date: Thu, 04 Aug 2022 Prob (F-statistic): 0.0172
Time: 22:24:31 Log-Likelihood: -8223.8
No. Observations: 5099 AIC: 1.645e+04
Df Residuals: 5097 BIC: 1.646e+04
Df Model: 1
Covariance Type: HC1
==============================================================================
coef std err t P>|t| [0.025 0.975]
------------------------------------------------------------------------------
Intercept 2.0568 0.021 98.156 0.000 2.016 2.098
T4 -0.0855 0.036 -2.383 0.017 -0.156 -0.015
==============================================================================
Omnibus: 2610.670 Durbin-Watson: 1.973
Prob(Omnibus): 0.000 Jarque-Bera (JB): 516.984
Skew: -0.542 Prob(JB): 5.47e-113
Kurtosis: 1.877 Cond. No. 2.41
==============================================================================
Notes:
[1] Standard Errors are heteroscedasticity robust (HC1)
OLS Regression Results
==============================================================================
Dep. Variable: inuidur1 R-squared: 0.060
Model: OLS Adj. R-squared: 0.040
Method: Least Squares F-statistic: 16.64
Date: Thu, 04 Aug 2022 Prob (F-statistic): 3.84e-244
Time: 22:24:31 Log-Likelihood: -8070.0
No. Observations: 5099 AIC: 1.635e+04
Df Residuals: 4995 BIC: 1.703e+04
Df Model: 103
Covariance Type: HC1
========================================================================================
coef std err t P>|t| [0.025 0.975]
----------------------------------------------------------------------------------------
(Intercept) 2.6331 0.368 7.153 0.000 1.911 3.355
T4TRUE -0.0797 0.036 -2.239 0.025 -0.149 -0.010
female -0.1146 0.316 -0.362 0.717 -0.735 0.506
black -0.8990 0.240 -3.742 0.000 -1.370 -0.428
othrace -2.6269 0.454 -5.784 0.000 -3.517 -1.737
factor(dep)1 -0.7197 0.581 -1.238 0.216 -1.859 0.420
factor(dep)2 -0.0406 0.360 -0.113 0.910 -0.746 0.665
q2 -0.1597 0.370 -0.431 0.666 -0.886 0.567
q3 -0.5399 0.370 -1.459 0.145 -1.265 0.186
q4 -0.4334 0.371 -1.167 0.243 -1.161 0.294
q5 -0.3452 0.369 -0.936 0.349 -1.068 0.378
q6 -0.4937 0.371 -1.330 0.184 -1.221 0.234
agelt35 -0.6259 0.308 -2.035 0.042 -1.229 -0.023
agegt54 -0.3614 0.712 -0.507 0.612 -1.758 1.035
durable -0.2792 0.492 -0.568 0.570 -1.243 0.684
lusd -0.2229 0.187 -1.190 0.234 -0.590 0.144
husd -0.1702 0.201 -0.847 0.397 -0.564 0.224
female:black -0.1550 0.122 -1.271 0.204 -0.394 0.084
female:othrace 0.3102 0.424 0.732 0.464 -0.520 1.141
female:factor(dep)1 -0.0279 0.118 -0.237 0.812 -0.258 0.202
female:factor(dep)2 0.1482 0.103 1.440 0.150 -0.054 0.350
female:q2 -0.0874 0.316 -0.277 0.782 -0.707 0.532
female:q3 0.2049 0.316 0.649 0.516 -0.414 0.824
female:q4 0.2732 0.316 0.866 0.387 -0.345 0.892
female:q5 0.0611 0.315 0.194 0.846 -0.556 0.678
female:q6 0.2872 0.338 0.849 0.396 -0.376 0.951
female:agelt35 0.1264 0.077 1.639 0.101 -0.025 0.278
female:agegt54 0.0400 0.127 0.314 0.754 -0.210 0.290
female:durable 0.0680 0.110 0.619 0.536 -0.147 0.283
female:lusd 0.0837 0.085 0.986 0.324 -0.083 0.250
female:husd 0.0623 0.094 0.663 0.507 -0.122 0.247
black:factor(dep)1 0.1575 0.194 0.810 0.418 -0.224 0.539
black:factor(dep)2 -0.1038 0.183 -0.567 0.571 -0.463 0.255
black:q2 0.4585 0.250 1.832 0.067 -0.032 0.949
black:q3 0.4166 0.241 1.731 0.084 -0.055 0.888
black:q4 0.5485 0.241 2.280 0.023 0.077 1.020
black:q5 0.7346 0.239 3.079 0.002 0.267 1.202
black:agelt35 0.0151 0.128 0.118 0.906 -0.236 0.266
black:agegt54 0.4438 0.203 2.183 0.029 0.045 0.842
black:durable 0.2436 0.177 1.378 0.168 -0.103 0.590
black:lusd 0.2910 0.152 1.919 0.055 -0.006 0.588
black:husd 1.3149 0.338 3.896 0.000 0.653 1.977
othrace:factor(dep)1 1.0736 0.641 1.674 0.094 -0.184 2.331
othrace:factor(dep)2 0.0070 0.429 0.016 0.987 -0.834 0.848
othrace:q2 1.7441 0.494 3.531 0.000 0.776 2.712
othrace:q3 1.3575 0.601 2.261 0.024 0.180 2.535
othrace:q4 1.4433 0.511 2.822 0.005 0.441 2.446
othrace:q5 1.4252 0.538 2.651 0.008 0.371 2.479
othrace:agelt35 1.1845 0.389 3.048 0.002 0.423 1.946
othrace:agegt54 -0.2219 0.695 -0.319 0.749 -1.584 1.140
othrace:durable 1.6280 0.365 4.464 0.000 0.913 2.343
othrace:lusd -0.0707 0.461 -0.153 0.878 -0.975 0.834
othrace:husd -0.7714 0.351 -2.197 0.028 -1.460 -0.083
factor(dep)1:q2 0.6398 0.573 1.116 0.264 -0.484 1.763
factor(dep)2:q2 -0.0445 0.358 -0.124 0.901 -0.747 0.658
factor(dep)1:q3 0.6984 0.574 1.217 0.224 -0.427 1.823
factor(dep)2:q3 -0.0295 0.359 -0.082 0.934 -0.734 0.674
factor(dep)1:q4 0.5041 0.574 0.879 0.379 -0.620 1.629
factor(dep)2:q4 0.1390 0.361 0.385 0.700 -0.569 0.848
factor(dep)1:q5 0.5278 0.571 0.924 0.355 -0.592 1.647
factor(dep)2:q5 -0.1697 0.359 -0.472 0.637 -0.874 0.535
factor(dep)1:q6 1.0950 0.603 1.816 0.069 -0.087 2.277
factor(dep)2:q6 0.3409 0.388 0.879 0.379 -0.419 1.101
factor(dep)1:agelt35 0.0746 0.122 0.612 0.541 -0.164 0.314
factor(dep)2:agelt35 0.0333 0.094 0.353 0.724 -0.152 0.218
factor(dep)1:agegt54 0.0725 0.169 0.429 0.668 -0.259 0.404
factor(dep)2:agegt54 0.1567 0.369 0.425 0.671 -0.566 0.879
factor(dep)1:durable 0.2946 0.149 1.979 0.048 0.003 0.586
factor(dep)2:durable 0.0454 0.120 0.379 0.705 -0.189 0.280
factor(dep)1:lusd 0.1500 0.128 1.169 0.242 -0.101 0.401
factor(dep)2:lusd 0.1826 0.113 1.617 0.106 -0.039 0.404
factor(dep)1:husd 0.0814 0.139 0.587 0.557 -0.190 0.353
factor(dep)2:husd 0.1522 0.121 1.258 0.209 -0.085 0.390
q2:agelt35 0.4302 0.307 1.401 0.161 -0.172 1.032
q2:agegt54 0.6712 0.709 0.947 0.344 -0.718 2.061
q2:durable -0.1064 0.488 -0.218 0.827 -1.062 0.850
q2:lusd -0.0428 0.190 -0.226 0.821 -0.414 0.329
q2:husd -0.0417 0.197 -0.212 0.832 -0.428 0.344
q3:agelt35 0.4545 0.307 1.479 0.139 -0.148 1.057
q3:agegt54 0.8660 0.709 1.221 0.222 -0.524 2.256
q3:durable 0.2450 0.487 0.503 0.615 -0.710 1.200
q3:lusd 0.0859 0.187 0.459 0.646 -0.281 0.453
q3:husd 0.1703 0.197 0.865 0.387 -0.216 0.556
q4:agelt35 0.3882 0.307 1.263 0.207 -0.214 0.991
q4:agegt54 0.5553 0.707 0.785 0.432 -0.832 1.942
q4:durable 0.2173 0.491 0.443 0.658 -0.745 1.180
q4:lusd -0.0950 0.188 -0.505 0.614 -0.464 0.274
q4:husd -0.1206 0.199 -0.606 0.545 -0.511 0.270
q5:agelt35 0.2780 0.306 0.908 0.364 -0.322 0.878
q5:agegt54 0.4515 0.706 0.639 0.523 -0.933 1.836
q5:durable 0.2881 0.487 0.591 0.554 -0.667 1.243
q5:lusd -0.1040 0.189 -0.550 0.582 -0.475 0.267
q5:husd -0.1523 0.197 -0.774 0.439 -0.538 0.234
q6:agelt35 0.3381 0.333 1.016 0.310 -0.314 0.990
q6:agegt54 0.9493 0.729 1.302 0.193 -0.480 2.378
q6:durable 0.4092 0.508 0.805 0.421 -0.587 1.405
agelt35:durable 0.0253 0.102 0.249 0.803 -0.174 0.224
agelt35:lusd -0.0653 0.088 -0.739 0.460 -0.238 0.108
agelt35:husd 0.0577 0.102 0.567 0.571 -0.142 0.257
agegt54:durable 0.0320 0.166 0.193 0.847 -0.293 0.357
agegt54:lusd -0.1482 0.137 -1.078 0.281 -0.418 0.121
agegt54:husd -0.3015 0.154 -1.961 0.050 -0.603 -0.000
durable:lusd 0.1158 0.110 1.052 0.293 -0.100 0.332
durable:husd 0.2376 0.129 1.842 0.066 -0.015 0.491
==============================================================================
Omnibus: 1286.589 Durbin-Watson: 1.987
Prob(Omnibus): 0.000 Jarque-Bera (JB): 424.494
Skew: -0.505 Prob(JB): 6.64e-93
Kurtosis: 2.010 Cond. No. 181.
==============================================================================
Notes:
[1] Standard Errors are heteroscedasticity robust (HC1)
The interactive specificaiton corresponds to the approach introduced in Lin (2013).
# create Y variable
log_inuidur1 = pd.DataFrame(np.log( Penn["inuidur1"] )).reset_index( drop = True )
# Reset index to estimation
# Get data from R
link="https://raw.githubusercontent.com/d2cml-ai/14.388_py/main/data/ols_ira_reg.RData"
response = urlopen(link)
content = response.read()
fhandle = open( 'ols_ira_reg.RData', 'wb')
fhandle.write(content)
fhandle.close()
result = pyreadr.read_r("ols_ira_reg.RData")
os.remove("ols_ira_reg.RData")
# Extracting the data frame from rdata_read
X_vars = result['S1']
ols_ira = sm.OLS( log_inuidur1, X_vars ).fit().get_robustcov_results(cov_type = "HC1")
# Results
print(ols_ira.summary())
OLS Regression Results
==============================================================================
Dep. Variable: inuidur1 R-squared: 0.079
Model: OLS Adj. R-squared: 0.041
Method: Least Squares F-statistic: 30.32
Date: Thu, 04 Aug 2022 Prob (F-statistic): 0.00
Time: 22:28:10 Log-Likelihood: -8016.3
No. Observations: 5099 AIC: 1.644e+04
Df Residuals: 4896 BIC: 1.777e+04
Df Model: 202
Covariance Type: HC1
================================================================================================
coef std err t P>|t| [0.025 0.975]
------------------------------------------------------------------------------------------------
(Intercept) 2.0576 0.021 99.055 0.000 2.017 2.098
T4TRUE -0.0755 0.036 -2.121 0.034 -0.145 -0.006
Xfemale -0.6663 0.409 -1.629 0.103 -1.468 0.136
Xblack -0.8635 0.298 -2.901 0.004 -1.447 -0.280
Xothrace -3.8177 0.939 -4.066 0.000 -5.658 -1.977
Xfactor(dep)1 0.0359 0.649 0.055 0.956 -1.237 1.309
Xfactor(dep)2 0.2118 0.452 0.468 0.640 -0.675 1.099
Xq2 -0.2546 0.456 -0.558 0.577 -1.149 0.640
Xq3 -0.6212 0.456 -1.362 0.173 -1.515 0.273
Xq4 -0.4799 0.457 -1.050 0.294 -1.376 0.416
Xq5 -0.3719 0.455 -0.817 0.414 -1.264 0.520
Xq6 -0.6770 0.453 -1.494 0.135 -1.566 0.212
Xagelt35 -0.6777 0.410 -1.651 0.099 -1.482 0.127
Xagegt54 -0.3041 0.702 -0.433 0.665 -1.681 1.073
Xdurable -0.8380 0.598 -1.402 0.161 -2.010 0.334
Xlusd -0.0995 0.228 -0.435 0.663 -0.547 0.348
Xhusd -0.0626 0.235 -0.266 0.790 -0.524 0.399
Xfemale:black -0.2155 0.151 -1.428 0.153 -0.511 0.080
Xfemale:othrace 0.5994 0.564 1.063 0.288 -0.506 1.705
Xfemale:factor(dep)1 -0.1734 0.142 -1.219 0.223 -0.452 0.105
Xfemale:factor(dep)2 0.2166 0.127 1.711 0.087 -0.032 0.465
Xfemale:q2 0.3919 0.408 0.961 0.336 -0.407 1.191
Xfemale:q3 0.6850 0.407 1.682 0.093 -0.114 1.484
Xfemale:q4 0.7214 0.407 1.772 0.076 -0.077 1.520
Xfemale:q5 0.5658 0.406 1.394 0.163 -0.230 1.361
Xfemale:q6 0.9082 0.431 2.105 0.035 0.062 1.754
Xfemale:agelt35 0.1701 0.095 1.785 0.074 -0.017 0.357
Xfemale:agegt54 0.2358 0.161 1.469 0.142 -0.079 0.550
Xfemale:durable 0.0974 0.138 0.706 0.480 -0.173 0.368
Xfemale:lusd 0.0720 0.107 0.674 0.500 -0.137 0.281
Xfemale:husd 0.0610 0.117 0.522 0.601 -0.168 0.290
Xblack:factor(dep)1 0.1090 0.229 0.476 0.634 -0.340 0.558
Xblack:factor(dep)2 -0.2007 0.229 -0.876 0.381 -0.650 0.248
Xblack:q2 0.4267 0.321 1.327 0.184 -0.204 1.057
Xblack:q3 0.3299 0.304 1.086 0.277 -0.266 0.925
Xblack:q4 0.5443 0.311 1.749 0.080 -0.066 1.155
Xblack:q5 0.6597 0.301 2.193 0.028 0.070 1.249
Xblack:agelt35 0.0830 0.159 0.523 0.601 -0.228 0.394
Xblack:agegt54 0.4230 0.255 1.656 0.098 -0.078 0.924
Xblack:durable 0.4681 0.228 2.053 0.040 0.021 0.915
Xblack:lusd 0.3086 0.185 1.670 0.095 -0.054 0.671
Xblack:husd 0.5498 0.661 0.832 0.406 -0.746 1.846
Xothrace:factor(dep)1 2.5202 1.860 1.355 0.175 -1.125 6.166
Xothrace:factor(dep)2 1.1889 0.575 2.069 0.039 0.062 2.315
Xothrace:q2 2.0826 0.610 3.415 0.001 0.887 3.278
Xothrace:q3 0.9373 0.662 1.416 0.157 -0.360 2.235
Xothrace:q4 3.8597 0.883 4.373 0.000 2.129 5.590
Xothrace:q5 0.9712 0.554 1.753 0.080 -0.115 2.057
Xothrace:agelt35 2.2480 0.918 2.450 0.014 0.449 4.047
Xothrace:agegt54 0.8198 0.903 0.908 0.364 -0.951 2.591
Xothrace:durable 1.7506 0.371 4.713 0.000 1.022 2.479
Xothrace:lusd -0.6944 0.496 -1.399 0.162 -1.668 0.279
Xothrace:husd -0.1798 0.614 -0.293 0.770 -1.383 1.024
Xfactor(dep)1:q2 0.2339 0.643 0.364 0.716 -1.027 1.495
Xfactor(dep)2:q2 -0.2177 0.449 -0.485 0.628 -1.098 0.663
Xfactor(dep)1:q3 0.1543 0.645 0.239 0.811 -1.111 1.419
Xfactor(dep)2:q3 -0.2545 0.451 -0.564 0.573 -1.139 0.630
Xfactor(dep)1:q4 -0.0239 0.644 -0.037 0.970 -1.286 1.238
Xfactor(dep)2:q4 -0.1619 0.452 -0.358 0.720 -1.048 0.725
Xfactor(dep)1:q5 0.1396 0.640 0.218 0.827 -1.115 1.394
Xfactor(dep)2:q5 -0.5626 0.450 -1.250 0.211 -1.445 0.319
Xfactor(dep)1:q6 0.4833 0.682 0.709 0.479 -0.854 1.820
Xfactor(dep)2:q6 -0.0048 0.478 -0.010 0.992 -0.943 0.933
Xfactor(dep)1:agelt35 0.0508 0.150 0.339 0.734 -0.243 0.344
Xfactor(dep)2:agelt35 0.1192 0.117 1.023 0.306 -0.109 0.348
Xfactor(dep)1:agegt54 0.0366 0.206 0.178 0.859 -0.367 0.440
Xfactor(dep)2:agegt54 0.2231 0.422 0.529 0.597 -0.604 1.050
Xfactor(dep)1:durable 0.3397 0.185 1.840 0.066 -0.022 0.702
Xfactor(dep)2:durable 0.1147 0.154 0.747 0.455 -0.186 0.416
Xfactor(dep)1:lusd -0.2604 0.162 -1.605 0.109 -0.578 0.058
Xfactor(dep)2:lusd 0.1151 0.140 0.821 0.412 -0.160 0.390
Xfactor(dep)1:husd -0.0428 0.166 -0.258 0.797 -0.369 0.283
Xfactor(dep)2:husd 0.0180 0.151 0.119 0.905 -0.279 0.315
Xq2:agelt35 0.5007 0.411 1.219 0.223 -0.304 1.306
Xq2:agegt54 0.4322 0.700 0.618 0.537 -0.939 1.804
Xq2:durable 0.2615 0.595 0.440 0.660 -0.904 1.427
Xq2:lusd -0.0675 0.231 -0.292 0.771 -0.521 0.386
Xq2:husd -0.1818 0.234 -0.776 0.438 -0.641 0.277
Xq3:agelt35 0.5137 0.411 1.251 0.211 -0.292 1.319
Xq3:agegt54 0.7246 0.697 1.039 0.299 -0.642 2.091
Xq3:durable 0.7224 0.593 1.218 0.223 -0.441 1.885
Xq3:lusd -0.0014 0.231 -0.006 0.995 -0.454 0.451
Xq3:husd 0.0989 0.232 0.426 0.670 -0.356 0.554
Xq4:agelt35 0.4048 0.411 0.986 0.324 -0.400 1.210
Xq4:agegt54 0.2469 0.695 0.355 0.723 -1.116 1.610
Xq4:durable 0.5938 0.599 0.991 0.322 -0.581 1.769
Xq4:lusd -0.1686 0.233 -0.724 0.469 -0.625 0.288
Xq4:husd -0.1451 0.235 -0.616 0.538 -0.607 0.316
Xq5:agelt35 0.2160 0.409 0.528 0.598 -0.586 1.018
Xq5:agegt54 0.0996 0.693 0.144 0.886 -1.260 1.459
Xq5:durable 0.8536 0.592 1.443 0.149 -0.306 2.014
Xq5:lusd -0.2593 0.235 -1.105 0.269 -0.719 0.201
Xq5:husd -0.1736 0.232 -0.748 0.455 -0.629 0.282
Xq6:agelt35 0.3824 0.435 0.878 0.380 -0.471 1.236
Xq6:agegt54 0.8362 0.730 1.146 0.252 -0.594 2.266
Xq6:durable 1.0289 0.620 1.660 0.097 -0.186 2.244
Xagelt35:durable -0.0027 0.126 -0.021 0.983 -0.249 0.244
Xagelt35:lusd -0.0574 0.110 -0.524 0.601 -0.272 0.157
Xagelt35:husd 0.0545 0.126 0.433 0.665 -0.192 0.301
Xagegt54:durable -0.1239 0.208 -0.596 0.551 -0.531 0.284
Xagegt54:lusd 0.0912 0.176 0.518 0.604 -0.254 0.437
Xagegt54:husd -0.3146 0.190 -1.658 0.097 -0.687 0.057
Xdurable:lusd 0.2634 0.138 1.907 0.057 -0.007 0.534
Xdurable:husd 0.3138 0.159 1.979 0.048 0.003 0.625
T4TRUE:Xfemale 1.5687 0.645 2.432 0.015 0.304 2.833
T4TRUE:Xblack -0.1681 0.527 -0.319 0.750 -1.202 0.865
T4TRUE:Xothrace 1.5323 1.010 1.518 0.129 -0.447 3.512
T4TRUE:Xfactor(dep)1 -2.3330 1.018 -2.293 0.022 -4.328 -0.338
T4TRUE:Xfactor(dep)2 -0.5623 0.709 -0.793 0.428 -1.952 0.827
T4TRUE:Xq2 0.3434 0.864 0.398 0.691 -1.350 2.036
T4TRUE:Xq3 0.2924 0.862 0.339 0.735 -1.398 1.983
T4TRUE:Xq4 0.1763 0.864 0.204 0.838 -1.517 1.869
T4TRUE:Xq5 0.1043 0.860 0.121 0.903 -1.581 1.789
T4TRUE:Xq6 0.5963 0.883 0.675 0.499 -1.134 2.327
T4TRUE:Xagelt35 0.1837 0.654 0.281 0.779 -1.099 1.466
T4TRUE:Xagegt54 0.2266 0.554 0.409 0.682 -0.859 1.312
T4TRUE:Xdurable 1.1589 0.803 1.443 0.149 -0.415 2.733
T4TRUE:Xlusd -0.4532 0.421 -1.076 0.282 -1.279 0.373
T4TRUE:Xhusd -0.4467 0.473 -0.944 0.345 -1.374 0.481
T4TRUE:Xfemale:black 0.1381 0.261 0.528 0.597 -0.374 0.651
T4TRUE:Xfemale:othrace -0.5587 0.772 -0.723 0.470 -2.073 0.955
T4TRUE:Xfemale:factor(dep)1 0.3961 0.244 1.627 0.104 -0.081 0.873
T4TRUE:Xfemale:factor(dep)2 -0.1082 0.220 -0.492 0.623 -0.540 0.323
T4TRUE:Xfemale:q2 -1.3293 0.638 -2.083 0.037 -2.581 -0.078
T4TRUE:Xfemale:q3 -1.3339 0.638 -2.089 0.037 -2.586 -0.082
T4TRUE:Xfemale:q4 -1.2681 0.639 -1.983 0.047 -2.522 -0.015
T4TRUE:Xfemale:q5 -1.4118 0.637 -2.217 0.027 -2.660 -0.164
T4TRUE:Xfemale:q6 -1.7085 0.702 -2.432 0.015 -3.086 -0.331
T4TRUE:Xfemale:agelt35 -0.0888 0.166 -0.535 0.592 -0.414 0.236
T4TRUE:Xfemale:agegt54 -0.4767 0.270 -1.763 0.078 -1.007 0.053
T4TRUE:Xfemale:durable -0.0767 0.243 -0.315 0.752 -0.553 0.400
T4TRUE:Xfemale:lusd -0.0369 0.181 -0.204 0.838 -0.392 0.318
T4TRUE:Xfemale:husd -0.1521 0.199 -0.765 0.444 -0.542 0.238
T4TRUE:Xblack:factor(dep)1 0.1904 0.443 0.430 0.667 -0.677 1.058
T4TRUE:Xblack:factor(dep)2 0.2898 0.388 0.747 0.455 -0.471 1.050
T4TRUE:Xblack:q2 0.1490 0.533 0.280 0.780 -0.896 1.194
T4TRUE:Xblack:q3 0.3089 0.521 0.593 0.553 -0.712 1.330
T4TRUE:Xblack:q4 0.0614 0.508 0.121 0.904 -0.934 1.056
T4TRUE:Xblack:q5 0.3031 0.518 0.585 0.558 -0.712 1.318
T4TRUE:Xblack:agelt35 -0.1701 0.277 -0.615 0.539 -0.712 0.372
T4TRUE:Xblack:agegt54 0.1066 0.424 0.252 0.801 -0.724 0.937
T4TRUE:Xblack:durable -0.7329 0.383 -1.915 0.056 -1.483 0.018
T4TRUE:Xblack:lusd 0.0108 0.321 0.034 0.973 -0.619 0.641
T4TRUE:Xblack:husd 1.3639 0.718 1.900 0.058 -0.044 2.772
T4TRUE:Xothrace:factor(dep)2 -1.4020 0.697 -2.011 0.044 -2.769 -0.035
T4TRUE:Xothrace:q2 -1.1359 0.919 -1.236 0.217 -2.937 0.666
T4TRUE:Xothrace:q3 1.0393 1.122 0.926 0.354 -1.160 3.239
T4TRUE:Xothrace:q4 -3.7042 1.089 -3.401 0.001 -5.839 -1.569
T4TRUE:Xothrace:q5 0.5951 0.957 0.622 0.534 -1.281 2.471
T4TRUE:Xothrace:agelt35 -0.7749 1.233 -0.629 0.530 -3.191 1.642
T4TRUE:Xothrace:agegt54 -0.5700 1.402 -0.406 0.684 -3.319 2.179
T4TRUE:Xothrace:durable 0.3781 1.019 0.371 0.711 -1.620 2.377
T4TRUE:Xothrace:lusd 1.2125 0.639 1.897 0.058 -0.041 2.466
T4TRUE:Xfactor(dep)1:q2 1.4339 1.004 1.428 0.153 -0.534 3.402
T4TRUE:Xfactor(dep)2:q2 0.2255 0.710 0.317 0.751 -1.167 1.618
T4TRUE:Xfactor(dep)1:q3 1.7205 1.002 1.718 0.086 -0.243 3.684
T4TRUE:Xfactor(dep)2:q3 0.4410 0.708 0.623 0.533 -0.946 1.828
T4TRUE:Xfactor(dep)1:q4 1.6610 1.005 1.653 0.098 -0.309 3.631
T4TRUE:Xfactor(dep)2:q4 0.7075 0.714 0.990 0.322 -0.693 2.108
T4TRUE:Xfactor(dep)1:q5 1.1550 0.997 1.159 0.246 -0.799 3.109
T4TRUE:Xfactor(dep)2:q5 0.9001 0.711 1.266 0.206 -0.494 2.294
T4TRUE:Xfactor(dep)1:q6 1.9447 1.094 1.778 0.075 -0.199 4.089
T4TRUE:Xfactor(dep)2:q6 0.9842 0.795 1.238 0.216 -0.574 2.543
T4TRUE:Xfactor(dep)1:agelt35 0.0376 0.251 0.150 0.881 -0.454 0.529
T4TRUE:Xfactor(dep)2:agelt35 -0.2680 0.204 -1.314 0.189 -0.668 0.132
T4TRUE:Xfactor(dep)1:agegt54 0.3310 0.351 0.942 0.346 -0.358 1.019
T4TRUE:Xfactor(dep)2:agegt54 -0.3165 0.635 -0.499 0.618 -1.561 0.928
T4TRUE:Xfactor(dep)1:durable -0.3936 0.349 -1.128 0.259 -1.077 0.290
T4TRUE:Xfactor(dep)2:durable -0.2344 0.259 -0.904 0.366 -0.743 0.274
T4TRUE:Xfactor(dep)1:lusd 1.1350 0.259 4.379 0.000 0.627 1.643
T4TRUE:Xfactor(dep)2:lusd 0.1783 0.239 0.746 0.456 -0.290 0.647
T4TRUE:Xfactor(dep)1:husd 0.3741 0.287 1.303 0.193 -0.189 0.937
T4TRUE:Xfactor(dep)2:husd 0.5146 0.256 2.008 0.045 0.012 1.017
T4TRUE:Xq2:agelt35 -0.3017 0.652 -0.463 0.644 -1.579 0.976
T4TRUE:Xq2:agegt54 0.1146 0.567 0.202 0.840 -0.998 1.227
T4TRUE:Xq2:durable -0.5168 0.778 -0.664 0.507 -2.042 1.008
T4TRUE:Xq2:lusd 0.1658 0.431 0.385 0.700 -0.679 1.011
T4TRUE:Xq2:husd 0.5323 0.462 1.153 0.249 -0.373 1.438
T4TRUE:Xq3:agelt35 -0.2257 0.652 -0.346 0.729 -1.504 1.053
T4TRUE:Xq3:agegt54 -0.1937 0.566 -0.342 0.732 -1.303 0.916
T4TRUE:Xq3:durable -0.8490 0.782 -1.085 0.278 -2.383 0.684
T4TRUE:Xq3:lusd 0.3147 0.423 0.745 0.456 -0.514 1.143
T4TRUE:Xq3:husd 0.3113 0.463 0.672 0.502 -0.597 1.220
T4TRUE:Xq4:agelt35 -0.1348 0.651 -0.207 0.836 -1.411 1.142
T4TRUE:Xq4:agegt54 0.3529 0.550 0.641 0.521 -0.726 1.432
T4TRUE:Xq4:durable -0.6281 0.795 -0.790 0.429 -2.186 0.930
T4TRUE:Xq4:lusd 0.3023 0.422 0.716 0.474 -0.526 1.130
T4TRUE:Xq4:husd 0.3029 0.469 0.646 0.518 -0.617 1.222
T4TRUE:Xq5:agelt35 0.0970 0.649 0.149 0.881 -1.176 1.370
T4TRUE:Xq5:agegt54 0.4823 0.556 0.868 0.386 -0.607 1.572
T4TRUE:Xq5:durable -1.2396 0.786 -1.578 0.115 -2.780 0.300
T4TRUE:Xq5:lusd 0.6158 0.426 1.446 0.148 -0.219 1.451
T4TRUE:Xq5:husd 0.2946 0.463 0.636 0.525 -0.614 1.203
T4TRUE:Xq6:agelt35 -0.0010 0.730 -0.001 0.999 -1.431 1.429
T4TRUE:Xq6:durable -1.3652 0.850 -1.607 0.108 -3.031 0.300
T4TRUE:Xagelt35:durable 0.1439 0.223 0.646 0.518 -0.293 0.581
T4TRUE:Xagelt35:lusd -0.0139 0.190 -0.073 0.942 -0.386 0.359
T4TRUE:Xagelt35:husd 0.0294 0.217 0.135 0.892 -0.397 0.456
T4TRUE:Xagegt54:durable 0.5449 0.343 1.588 0.112 -0.128 1.217
T4TRUE:Xagegt54:lusd -0.5794 0.288 -2.013 0.044 -1.143 -0.015
T4TRUE:Xagegt54:husd 0.1910 0.328 0.583 0.560 -0.451 0.833
T4TRUE:Xdurable:lusd -0.3744 0.240 -1.560 0.119 -0.845 0.096
T4TRUE:Xdurable:husd -0.3381 0.277 -1.219 0.223 -0.882 0.206
==============================================================================
Omnibus: 1106.287 Durbin-Watson: 1.985
Prob(Omnibus): 0.000 Jarque-Bera (JB): 404.801
Skew: -0.498 Prob(JB): 1.25e-88
Kurtosis: 2.044 Cond. No. 325.
==============================================================================
Notes:
[1] Standard Errors are heteroscedasticity robust (HC1)
C:\Users\User\anaconda3\lib\site-packages\statsmodels\base\model.py:1871: ValueWarning: covariance of constraints does not have full rank. The number of constraints is 202, but rank is 197
warnings.warn('covariance of constraints does not have full '
Next we try out partialling out with lasso
import hdmpy
Next we try out partialling out with lasso
# Get data from R
link="https://raw.githubusercontent.com/d2cml-ai/14.388_py/main/data/rlasso_ira_reg.RData"
response = urlopen(link)
content = response.read()
fhandle = open( 'rlasso_ira_reg.RData', 'wb')
fhandle.write(content)
fhandle.close()
result = pyreadr.read_r("rlasso_ira_reg.RData")
os.remove("rlasso_ira_reg.RData")
# Extracting the data frame from rdata_read
X_vars = result['S']
result = hdmpy.rlassoEffects( X_vars, log_inuidur1, index = 0 )
rlasso_ira = pd.DataFrame(np.array( (result.res['coefficients'][0] , result.res['se'][0] , \
result.res['t'][0] , result.res['pval'][0] ) ).reshape(1, 4) , columns = ['Coef.' , \
"Std.Err." , "t" , 'P>|t|'] , index = ['T4'])
rlasso_ira
Coef. | Std.Err. | t | P>|t| | |
---|---|---|---|---|
T4 | -0.078886 | 0.03553 | -2.220289 | 0.026399 |
6.5. Results#
ols_ira.summary2().tables[1]['Coef.']["T4TRUE"]
-0.07550054941649004
table2 = np.zeros((2, 4))
table2[0,0] = ols_cl.summary2().tables[1]['Coef.']['T4']
table2[0,1] = ols_cra.summary2().tables[1]['Coef.']['T4TRUE']
table2[0,2] = ols_ira.summary2().tables[1]['Coef.']['T4TRUE']
table2[0,3] = rlasso_ira['Coef.']['T4']
table2[1,0] = ols_cl.summary2().tables[1]['Std.Err.']['T4']
table2[1,1] = ols_cra.summary2().tables[1]['Std.Err.']['T4TRUE']
table2[1,2] = ols_ira.summary2().tables[1]['Std.Err.']['T4TRUE']
table2[1,3] = rlasso_ira['Std.Err.']['T4']
table2 = pd.DataFrame(table2, columns = ["$CL$", "$CRA$", "$IRA$", "$IRA Lasso$"], \
index = ["estimate","standard error"])
table2
$CL$ | $CRA$ | $IRA$ | $IRA Lasso$ | |
---|---|---|---|---|
estimate | -0.085455 | -0.079680 | -0.075501 | -0.078886 |
standard error | 0.035856 | 0.035591 | 0.035605 | 0.035530 |
Treatment group 4 experiences an average decrease of about \(7.8\%\) in the length of unemployment spell.
Observe that regression estimators delivers estimates that are slighly more efficient (lower standard errors) than the simple 2 mean estimator, but essentially all methods have very similar standard errors. From IRA results we also see that there is not any statistically detectable heterogeneity. We also see the regression estimators offer slightly lower estimates – these difference occur perhaps to due minor imbalance in the treatment allocation, which the regression estimators try to correct.