Faculty Sponsor: Professor Gooyabadi
Live Poster Session:
Time: May 1, 2026 01:00 PM Eastern Time (US and Canada)
Join Zoom Meeting
https://wesleyan.zoom.us/j/97590204356

Olivier Hart-Vilain
Olivier is a Junior at Wesleyan University. He is a Neuroscience and Behavior major and an Informatics and Modeling minor through the Integrative Genomic Sciences (IGS) pathway. Olivier is a lab researcher in the Melón Translational Neuroscience Lab. His passion for understanding the subconscious underlying behavior fostered curiosity in how perception of others and their trustworthiness relates to support for welfare.
Abstract: This study aimed to investigate the relationship between social trust and perceptions of how the government should behave in regards to increasing, maintaining, or decreasing support of poor citizens of the United States. Current literature indicates a variety of nations in both Asia and Europe exhibit a positive relationship between social trust and support for welfare efforts, as well as broader government regulation (Wen, et al. 2022; Aghion, et al. 2010; Mewes, 2024). The question answered in this study is whether this relationship exists in adults living in the United States. This question is incredibly pertinent to understanding the effect of the United States’s social and political culture in which freedom and a minimization of government influence is dominant. It was found that this relationship does not exist in the United States, even when controlling for sex and perceived fairness of others. The implication of this finding is that people in the United States relate to each other in a fundamentally different way from citizens in a variety of other countries, perhaps implying a justification for welfare with a distinct ideological foundation.
OHV-QAC201-PresentationCode:
–– coding: utf-8 ––
“””
Spyder Editor
This is a temporary script file.
“””
!/usr/bin/env python3
–– coding: utf-8 ––
“””
Created on Sun Feb 22 19:31:13 2026
@author: olivierhart-vilain
“””
import pandas as pd
import numpy as np
myData = pd.read_csv(“/Users/olivierhart-vilain/Library/CloudStorage/OneDrive-wesleyan.edu/Olivier Hart-Vilain QAC201/GSS2024.csv”)
myData=myData[[‘trust’,’helppoor’,’helpsick’,’fair’,’helpful’, ‘sex’, ‘partyid’]]
Replace codes with NaN for gov questions
myData.loc[myData[‘helppoor’].isin([‘D’, ‘N’]), ‘helppoor’] = np.nan
myData.loc[myData[‘helpsick’].isin([‘D’, ‘N’, ‘I’, ‘S’]), ‘helpsick’] = np.nan
Normalize 1 2 and 3 for people questions, Code out missing data
myData[‘fair’] = myData[‘fair’].replace({1: 2, 2: 3, 3: 1})
myData[‘trust’] = myData[‘trust’].replace({2: 3, 3: 2})
myData.loc[myData[‘fair’].isin([‘D’, ‘N’]), ‘fair’] = np.nan
myData.loc[myData[‘helpful’].isin([‘D’, ‘N’, ‘I’, ‘S’]), ‘helpful’] = np.nan
myData.loc[myData[‘sex’].isin([‘D’, ‘N’, ‘S’]), ‘sex’] = np.nan
myData[‘sex’] = myData[‘sex’].replace({2: 0})
names don’t need to be changed- already intuitive
print(myData[‘helppoor’].describe())
print(myData[‘helpsick’].describe())
print(myData[‘fair’].describe())
print(myData[‘helpful’].describe())
Save file
myData.to_csv(‘GSS.csv’, index=False)
import matplotlib.pyplot as plt
import seaborn as sns
sns.countplot(x=”helpful”, data=myData)
plt.xlabel(“helpful”)
plt.title(“helpfulplot”)
plt.show()
import matplotlib.pyplot as plt
import seaborn as sns
sns.countplot(x=”fair”, data=myData)
plt.xlabel(“fair”)
plt.title(“fairplot”)
plt.show()
import matplotlib.pyplot as plt
import seaborn as sns
sns.countplot(data=myData, x=’helppoor’)
plt.title(“helppoor plot”)
plt.show()
import matplotlib.pyplot as plt
import seaborn as sns
sns.histplot(data=myData, x=’helpsick’, bins=30, kde=True)
plt.title(“helpsick plot”)
plt.show()
import statsmodels.formula.api as smf
import statsmodels.stats.multicomp as multi
model1= smf.ols(formula=’helppoor~ C(trust)’, data=myData)
results1=model1.fit()
print (results1.summary())
Post-hoc test
sub1=myData[[‘helppoor’,’trust’]].dropna()
mc1=multi.MultiComparison(sub1[‘helppoor’],sub1[‘trust’])
res1= mc1.tukeyhsd()
print(res1.summary())
sns.boxplot(data=myData, x=’trust’, y=’helppoor’)
plt.ylabel(“Mean of Helppoor”)
plt.title(“Social Trust and Welfare Support”)
plt.show()
import matplotlib.pyplot as plt
import seaborn as sns
sns.barplot(x=”trust”, y=”helppoor”, hue=”fair”, data=myData, ci=None)
plt.xlabel(‘trust’)
plt.ylabel(‘helppoor’)
plt.title(‘Welfare Support and Social Trust by Percieved Fairness of Others’)
plt.show()
import statsmodels.formula.api as smf
import pandas as pd
import numpy as np
If the Explanatory Variable is Quantitative
my_lm_quant = smf.ols(‘helppoor ~ trust’, data=myData).fit()
print(my_lm_quant.summary())
If the explanatory variable is Categorical
Convert categorical variable to ‘category’ type if necessary
myData[‘trust’] = myData[‘trust’].astype(‘category’)
my_lm_categ = smf.ols(‘helppoor ~ trust’, data=myData).fit()
print(my_lm_categ.summary())
import statsmodels.formula.api as smf
my_lm = smf.ols(‘helppoor ~ trust + fair + trust:fair’, data=myData).fit()
print(my_lm.summary())
import numpy as np
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
Remove rows with missing values in variables used for the model
regData = myData[[‘trust’, ‘helppoor’]].dropna()
X = regData[[‘trust’]]
X = sm.add_constant(X) # Adds intercept
y = regData[‘helppoor’]
mod1 = sm.OLS(y, X).fit()
print(mod1.summary())
Create prediction data
graphdata1 = pd.DataFrame({
‘trust’: np.linspace(regData[‘trust’].astype(float).min(),
regData[‘trust’].astype(float).max(), 100)
})
X_new = sm.add_constant(graphdata1)
predictions = mod1.get_prediction(X_new)
pred_summary = predictions.summary_frame(alpha=0.05)
graphdata1[‘fit’] = pred_summary[‘mean’]
graphdata1[‘LL’] = pred_summary[‘mean_ci_lower’]
graphdata1[‘UL’] = pred_summary[‘mean_ci_upper’]
Plot
plt.figure(figsize=(10, 6))
plt.plot(graphdata1[‘trust’], graphdata1[‘fit’], color=’red’, linewidth=2)
plt.fill_between(graphdata1[‘trust’], graphdata1[‘LL’], graphdata1[‘UL’], color=’gray’, alpha=0.3)
plt.scatter(graphdata1[‘trust’], graphdata1[‘fit’], color=’black’, s=50)
plt.xlabel(‘trust’)
plt.ylabel(‘Predicted Welfare Support View’)
plt.title(‘Welfare Support Prediction with Confidence Interval’)
plt.show()
import statsmodels.formula.api as smf
my_lm = smf.ols(‘helppoor ~ trust + sex + trust:sex’, data=myData).fit()
print(my_lm.summary())
myData[‘helppoor’].value_counts(normalize = True, sort=False, dropna=False)
import matplotlib.pyplot as plt
import seaborn as sns
sns.barplot(x=”trust”, y=”helppoor”, hue=”partyid”, data=myData, ci=None)
plt.xlabel(‘trust’)
plt.ylabel(‘helppoor’)
plt.title(‘Welfare Support and Social Trust by Percieved Fairness of Others’)
plt.show()
import statsmodels.formula.api as smf
import pandas as pd
import numpy as np
If the Explanatory Variable is Quantitative
my_lm_quant = smf.ols(‘helppoor ~ trust’, data=myData).fit()
print(my_lm_quant.summary())
If the explanatory variable is Categorical
Convert categorical variable to ‘category’ type if necessary
myData[‘trust’] = myData[‘trust’].astype(‘category’)
my_lm_categ = smf.ols(‘helppoor ~ trust’, data=myData).fit()
print(my_lm_categ.summary())
import statsmodels.formula.api as smf
my_lm = smf.ols(‘helppoor ~ trust + partyid + trust:partyid’, data=myData).fit()
print(my_lm.summary())
import numpy as np
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
Remove rows with missing values in variables used for the model
regData = myData[[‘trust’, ‘helppoor’]].dropna()
X = regData[[‘trust’]]
X = sm.add_constant(X) # Adds intercept
y = regData[‘helppoor’]
mod1 = sm.OLS(y, X).fit()
print(mod1.summary())
Create prediction data
graphdata1 = pd.DataFrame({
‘trust’: np.linspace(regData[‘trust’].astype(float).min(),
regData[‘trust’].astype(float).max(), 100)
})
X_new = sm.add_constant(graphdata1)
predictions = mod1.get_prediction(X_new)
pred_summary = predictions.summary_frame(alpha=0.05)
graphdata1[‘fit’] = pred_summary[‘mean’]
graphdata1[‘LL’] = pred_summary[‘mean_ci_lower’]
graphdata1[‘UL’] = pred_summary[‘mean_ci_upper’]
Plot
plt.figure(figsize=(10, 6))
plt.plot(graphdata1[‘trust’], graphdata1[‘fit’], color=’red’, linewidth=2)
plt.fill_between(graphdata1[‘trust’], graphdata1[‘LL’], graphdata1[‘UL’], color=’gray’, alpha=0.3)
plt.scatter(graphdata1[‘trust’], graphdata1[‘fit’], color=’black’, s=50)
plt.xlabel(‘trust’)
plt.ylabel(‘Predicted Welfare Support View’)
plt.title(‘Welfare Support Prediction with Confidence Interval’)
plt.show()
import statsmodels.formula.api as smf
