9) How Can Stock Market Mitigate the Israeli-Palestinian Conflict?¶
E-mail: econometrics.methods@gmail.com
Last updated: 11-5-2020
“Commerce is a cure for the most destructive prejudices.” (Montesquieu, 1748: Vol II, Ch 1)
Jha & Shayo (2019) randomly split 1345 Jewish Israeli voters between financial asset treatment and control groups. They reported that exposure to the stock market increases 4-6% the probability of voting for parties that favor a peaceful resolution of the conflict. Let’s open the dataset of Jha & Shayo (2019). Each row is a Israeli citizen.
import numpy as np
import pandas as pd
pd.set_option('precision', 3)
# Data from Jha & Shayo (2019)
path = "https://github.com/causal-methods/Data/raw/master/"
df = pd.read_stata(path + "replicationdata.dta")
df.head(5)
C:\Anaconda\envs\textbook\lib\site-packages\pandas\io\stata.py:1433: UnicodeWarning:
One or more strings in the dta file could not be decoded using utf-8, and
so the fallback encoding of latin-1 is being used. This can happen when a file
has been incorrectly encoded by Stata or some other software. You should verify
the string values returned are correct.
warnings.warn(msg, UnicodeWarning)
stat | tradestock6 | willingrisk1to10 | uid | male | rel | relid | nafa | edu | ses | ... | tradetot_m4 | pricechange_m4 | bought_bm4 | sold_bm4 | active_bm4 | assettype | lastweek | last3yrs | nextweek | facts_0_m4 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | completed | NaN | 3 | 60814.0 | 0.0 | jewish | secular | jerusalem | MA | Below Average | ... | 3.0 | -0.673 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 1.0 | 2.0 |
1 | completed | 1.0 | 2 | 60824.0 | 0.0 | jewish | secular | tel-aviv | BA | Above Average | ... | 3.0 | 5.323 | 2.0 | 0.0 | 2.0 | 1.0 | 1.0 | 1.0 | 0.0 | 3.0 |
2 | completed | 0.0 | 3 | 61067.0 | 1.0 | jewish | secular | center | PhD | Above Average | ... | 3.0 | 0.000 | 2.0 | 1.0 | 3.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
3 | completed | NaN | 4 | 61095.0 | 1.0 | jewish | secular | haifa | BA student | Below Average | ... | 3.0 | 5.323 | 3.0 | 2.0 | 3.0 | 0.0 | 0.0 | 1.0 | 0.0 | 1.0 |
4 | completed | 0.0 | 4 | 61198.0 | 1.0 | jewish | secular | north | MA | Below Average | ... | 3.0 | 0.000 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 |
5 rows × 526 columns
# Drop missing values
df = df.dropna(subset=['left_s3'])
Graphic 1 shows that the control and treatment group voted similarly in the 2013 election. But in 2015, the left-wing party received 24.8% of the votes in the control group against 30.9% in the treatment group. In a reverse way, the right-wing party received 35.8% of the votes in the control group against 31.2% in the treatment group. According to Jha & Shayo (2019), both right and left parties are similar in terms of economic policies. The main difference is that the left party favors a peaceful process, while the right party sees that any concession for peace would put at risk the State of Israel.
# Data: Vote Share by year
v2013 = df.groupby('assettreat')['left_2013', 'right_2013'].mean().T
v2015 = df.groupby('assettreat')['left_s3', 'right_s3'].mean().T
prop = v2013.append(v2015)
# Plot Bar Chart
import plotly.graph_objects as go
node = ['Left 2013', 'Right 2013', 'Left 2015', 'Right 2015']
fig = go.Figure(data=[
go.Bar(name='Control', x=node, y = prop[0]),
go.Bar(name='Treatment', x=node, y = prop[1]) ])
fig.update_layout(barmode='group',
title_text = 'Graphic 1 - Elections: 2013 vs 2015 ',
font=dict(size=18) )
fig.update_yaxes(title_text = "Vote Share")
fig.show()
C:\Anaconda\envs\textbook\lib\site-packages\ipykernel_launcher.py:2: FutureWarning: Indexing with multiple keys (implicitly converted to a tuple of keys) will be deprecated, use a list instead.
C:\Anaconda\envs\textbook\lib\site-packages\ipykernel_launcher.py:3: FutureWarning: Indexing with multiple keys (implicitly converted to a tuple of keys) will be deprecated, use a list instead.
This is separate from the ipykernel package so we can avoid doing imports until
The table below shows that the treatment group is similar to the control group. The exceptions are age and willingness to take risks. Israelites in the treatment group are younger than the control group (39.3 vs. 41.5 years old). The treatment group also has a higher preference to take risks evaluated in an index that varies from 1 to 10 (4.7 vs. 4.3).
We calculate the p-values based on OLS regressions with strata fixed effects.
control = ['right_2013', 'left_2013', 'p_index_s1', 'e_index_init',
'tradestock6all', 'male', 'age', 'postsecondary', 'BA_student',
'college_grad', 'married', 'r_sec', 'r_trad', 'r_relig', 'r_ultra',
'g_jerusalem', 'g_north', 'g_haifa', 'g_center', 'g_telaviv', 'g_south',
'g_wb', 'faminc', 'willingrisk1to10', 'patient', 'plitscore']
import statsmodels.formula.api as smf
result = []
for var in control:
# OLS with 104 randomization strata fixed effects
reg = smf.ols(var + "~ 1 + assettreat + C(block13)", df)
# 104 is the last variable: the coefficient of assettreat
pvalue = reg.fit().pvalues[104]
result.append(pvalue)
C:\Anaconda\envs\textbook\lib\site-packages\statsmodels\tools\_testing.py:19: FutureWarning:
pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.
table = df.groupby('assettreat')[control].mean().T
table['p-value'] = result
table
assettreat | 0.0 | 1.0 | p-value |
---|---|---|---|
right_2013 | 0.245 | 0.241 | 0.964 |
left_2013 | 0.126 | 0.137 | 0.213 |
p_index_s1 | 0.004 | 0.051 | 0.399 |
e_index_init | -0.005 | 0.007 | 0.752 |
tradestock6all | 0.368 | 0.355 | 0.290 |
male | 0.513 | 0.521 | 0.470 |
age | 41.530 | 39.289 | 0.011 |
postsecondary | 0.232 | 0.230 | 0.953 |
BA_student | 0.152 | 0.148 | 0.834 |
college_grad | 0.427 | 0.426 | 0.860 |
married | 0.629 | 0.598 | 0.295 |
r_sec | 0.636 | 0.627 | 0.582 |
r_trad | 0.172 | 0.164 | 0.823 |
r_relig | 0.119 | 0.124 | 0.780 |
r_ultra | 0.073 | 0.085 | 0.222 |
g_jerusalem | 0.096 | 0.091 | 0.800 |
g_north | 0.089 | 0.097 | 0.595 |
g_haifa | 0.123 | 0.142 | 0.290 |
g_center | 0.298 | 0.290 | 0.766 |
g_telaviv | 0.212 | 0.194 | 0.276 |
g_south | 0.116 | 0.104 | 0.596 |
g_wb | 0.066 | 0.081 | 0.341 |
faminc | 11162.162 | 10996.970 | 0.511 |
willingrisk1to10 | 4.344 | 4.716 | 0.009 |
patient | 0.642 | 0.657 | 0.645 |
plitscore | 69.726 | 70.664 | 0.550 |
# Library to print professional publication
# tables in Latex, HTML, etc.
!pip install stargazer
Requirement already satisfied: stargazer in c:\anaconda\envs\textbook\lib\site-packages (0.0.5)
WARNING: Error parsing requirements for numpy: [Errno 2] No such file or directory: 'c:\\anaconda\\envs\\textbook\\lib\\site-packages\\numpy-1.19.2.dist-info\\METADATA'
Collum 1 of Table 1 shows that the estimate of intent to treat (ITT) is 6.1%. It is worth mentioning that this type of experiment rarely has full compliance. Usually, when it is necessary to follow individuals over time, there is an attrition rate for both the control and treatment groups.
Collum 2 shows that the ITT effect is robust to the addition of control variables and strata fixed effects.
Collum 3 presents the Weighted Least Squares (WLS) using the variable “vote_wgt” as weight. Jha & Shayo (2019) extracted a random sample, where the non-orthodox center voters were oversampled. The logic is to increase the precision for the most interesting group: swing voters. The use of weights allows reproducing the results without oversampling.
Collum 4 shows that the results are driven by individuals in the treatment group that received Israeli stocks (“isrstock”) and voucher to invest (“cash”). Be careful to conclude that Palestinian stocks have no effect. In the period of the experiment, the price of Israeli stocks increased but the Palestinian stocks decreased.
ITT1 = smf.ols("left_s3 ~ 1 + assettreat",
df).fit()
Xs = ['right_2013', 'left_2013', 'male', 'age', 'age2',
'postsecondary', 'BA_student', 'college_grad',
'married', 'tradestock6all', 'r_trad', 'r_relig',
'r_ultra', 'g_jerusalem', 'g_north', 'g_haifa',
'g_telaviv', 'g_south', 'g_wb', 'C(newses)',
'willingrisk1to10', 'patient', 'plitscore']
controls = ""
for X in Xs:
controls = controls + '+' + X
ITT2 = smf.ols("left_s3 ~ 1 + assettreat" + controls +
"+C(block13)", df).fit()
WLS = smf.wls("left_s3 ~ 1 + assettreat" + controls +
"+C(block13)", df, weights=df['vote_wgt']).fit()
treatments = "+ isrstock + palstock + cash"
WLS2 = smf.wls("left_s3 ~ 1" + treatments + controls +
"+C(block13)", df, weights=df['vote_wgt']).fit()
# Settings for a nice table
from stargazer.stargazer import Stargazer
stargazer = Stargazer([ITT1, ITT2, WLS, WLS2])
stargazer.title('Table 1 - Intent to Treat Estimates of Stock'
+ ' Exposure on Voting for a Left Party')
names = ['ITT', 'ITT', 'WLS', 'WLS']
stargazer.custom_columns(names, [1, 1, 1, 1])
stargazer.covariate_order(['assettreat', 'isrstock',
'palstock', 'cash'])
stargazer.add_line('Strata Fixed Effects', ['No', 'Yes',
'Yes', 'Yes'])
stargazer.add_line('Covariates', ['No', 'Yes', 'Yes', 'Yes'])
stargazer
Dependent variable:left_s3 | ||||
ITT | ITT | WLS | WLS | |
(1) | (2) | (3) | (4) | |
assettreat | 0.061** | 0.059** | 0.043** | |
(0.030) | (0.024) | (0.020) | ||
isrstock | 0.053** | |||
(0.024) | ||||
palstock | 0.024 | |||
(0.024) | ||||
cash | 0.065** | |||
(0.029) | ||||
Strata Fixed Effects | No | Yes | Yes | Yes |
Covariates | No | Yes | Yes | Yes |
Observations | 1,311 | 1,311 | 1,311 | 1,311 |
R2 | 0.003 | 0.447 | 0.570 | 0.571 |
Adjusted R2 | 0.002 | 0.385 | 0.522 | 0.522 |
Residual Std. Error | 0.456 (df=1309) | 0.358 (df=1178) | 0.308 (df=1178) | 0.308 (df=1176) |
F Statistic | 4.146** (df=1; 1309) | 7.225*** (df=132; 1178) | 11.834*** (df=132; 1178) | 11.689*** (df=134; 1176) |
Note: | *p<0.1; **p<0.05; ***p<0.01 |
Column 1 of Table 2 presents the First Stage regression. The ITT (“assettreat”) is the Instrumental Variable (IV) for compliance assignment (“asset_comp”). The variable “asset_comp” indicates who actually completed the experiment. After controlling for several covariates and Strata Fixed Effects, the coefficient of ITT is statistically significant. The variable “assettreat” is a perfect IV. This variable was randomized. Therefore, it is uncorrelated with the error term.
Column 2 shows the result of the Control Function Approach (CF). The estimate of the treatment effect on the treated (TOT) is 7.3%. The treated individuals have the probability of voting for the left party increased by 7.3%. In this framework, the CF is equivalent to 2SLS. In the CF, we use the residual (\(\hat{u}\)) of the first stage to control for endogeneity in the second stage. Note that the residual is statistically significant. Therefore, correction is necessary. We can conclude that Table 1 underestimates the impact of financial asset exposure on voting for the left party.
# Fist Stage
FS = smf.ols("asset_comp ~ 1 + assettreat" + controls +
"+C(block13)", df).fit()
# Control Function Approach
df['resid'] = FS.resid
CF = smf.ols("left_s3 ~ 1 + asset_comp + resid" + controls +
"+C(block13)", df).fit()
# Settings for a nice table
stargazer = Stargazer([FS, CF])
stargazer.title('Table 2 - Impact of Stock Exposure'
' on Voting for a Left Party')
names = ['First Stage', 'Control Function']
stargazer.custom_columns(names, [1, 1])
stargazer.covariate_order(['assettreat', 'asset_comp', 'resid'])
stargazer.add_line('Strata Fixed Effects', ['Yes', 'Yes'])
stargazer.add_line('Covariates', ['Yes', 'Yes'])
stargazer
First Stage | Control Function | |
(1) | (2) | |
assettreat | 0.809*** | |
(0.022) | ||
asset_comp | 0.073** | |
(0.029) | ||
resid | -0.094** | |
(0.043) | ||
Strata Fixed Effects | Yes | Yes |
Covariates | Yes | Yes |
Observations | 1,311 | 1,311 |
R2 | 0.586 | 0.448 |
Adjusted R2 | 0.540 | 0.385 |
Residual Std. Error | 0.327 (df=1178) | 0.358 (df=1177) |
F Statistic | 12.654*** (df=132; 1178) | 7.171*** (df=133; 1177) |
Note: | *p<0.1; **p<0.05; ***p<0.01 |
Exercises¶
1| The sample of Jha & Shayo (2019) is composed of Israeli voters. Speculate if the results would be qualitatively the same in the case of Palestinian voters. Justify your reasons.
2| What would be a promising research question that departs from Jha & Shayo (2019)?
3| What is social desirability bias? Describe what Jha & Shayo (2019) did to mitigate the social desirability bias.
4| Replicate the results of Table 2 using 2SLS rather than Control Function Approach. Do not use the library “linearmodels”. Do the 2SLS manually using the library “statsmodels”.
5| Do the exposure to Palestinian stocks decrease the probability of voting for right-wing parties? Run some regressions to justify your position.
Reference¶
Jha, S. and Shayo, M. (2019). Valuing Peace: The Effects of Financial Market Exposure on Votes and Political Attitudes. Econometrica, 87: 1561-1588.
Montesquieu, C. (1748). The Spirit of the Laws. London: T. Evans, 1777, 4 vols. Vol. 2. Online Library of Liberty.