feat(script): Add findings table as computation

This commit is contained in:
Marty Oehme 2024-02-14 22:36:00 +01:00
parent 588cf4a3c9
commit 004c2f7410
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -560,7 +560,7 @@ Should they point towards gaps (or over-optimization) of specific areas of inter
#| fig-cap: Predominant type of intervention #| fig-cap: Predominant type of intervention
by_intervention = ( by_intervention = (
bib_df.groupby(["author", "year", "title", "design", "method", "representativeness"]) bib_df.groupby(["author", "year", "title", "design", "method", "representativeness", "citation"])
.agg( .agg(
{ {
"intervention": lambda _col: "; ".join(_col), "intervention": lambda _col: "; ".join(_col),
@ -615,49 +615,46 @@ to better identify areas of strong analytical lenses or areas of more limited an
from src import prep_data from src import prep_data
validities = prep_data.calculate_validities(by_intervention) validities = prep_data.calculate_validities(by_intervention)
validities["identifier"] = validities["author"].str.replace(r',.*$', '', regex=True) + " (" + validities["year"].astype(str) + ")"
g = sns.PairGrid(validities[["internal_validity", "external_validity", "identifier"]].drop_duplicates(subset="identifier"),
x_vars=["internal_validity", "external_validity"], y_vars = ["identifier"]
)
# Melt the dataframe to long format for plotting
# melted_validities = validities.melt(value_vars=['valid_int', 'valid_ext'], id_vars
# ='intervention', var_name='Validity')
# Create a stacked histplot using Seaborn # Create a stacked histplot using Seaborn
sns.scatterplot(data=validities, x='external_validity', y='internal_validity', hue='intervention') #sns.scatterplot(data=validities, x='external_validity', y='internal_validity', hue='intervention')
``` ```
## Institutional ## Institutional
{{< portrait >}} {{< portrait >}}
| area of policy | findings | channels |
|:----------------------------------|:--------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------|
| minimum wage | mixed evidence for short-/medium-term income inequality impacts | can lead to income compression at higher-earner ends |
| | some evidence for long-term inequality decrease | job loss offsets through higher wages |
| | | some spatial transfer from urban manufacturing sectors to rural agricultural sectors |
| | bad targeting can exacerbate existing inequalities | negative effect on women's hours worked if strong household labour divisions |
| | | low-earners sometimes secondary high-income household earners while low-wage households have no earners at all |
| | potential impact larger for single parents, rural/disadvantaged locations | women more affected if they make up large share of low-wage earners |
| | | |
| paid leave | evidence for significant increase in rtw after childbirth | esp. disadvantaged women benefit due to no prior employer-funded leave |
| | some evidence for positive rtw effects to occur with medium-/long-term time delay | short-term exit but no long-term increase to hiring pattern discrimination |
| | | can exacerbate existing household labour division |
| | mixed evidence for fixed-/short-term contracts counter-acting effect on rtw | fixed-term contracts often insufficiently covered by otherwise applicable labour regulation |
| | | |
| collective bargaining | evidence for decreased income inequality with strong unionisation | stronger collective political power vector enables more equal redistributive policies |
| | | increased probability for employment on formal, standard employment contract |
| | marginal evidence for increased income/representation of women/minorities in workforce/management | internal heterogeneity due to predominantly affecting median part of wage distribution |
| | | self-selection of people joining more unionised enterprises/organisations/sectors |
| | | depending on targeting of concurrent policies can bestow more benefits on men, increasing horizontal inequalit |
| | | ies |
| protective environmental policies | evidence for decrease in spatial inequality | increased employment probability through large-scale rural energy projects |
| | | |
| | mixed evidence for increase of existing inequalities | elite policy capture can exacerbate existing social exclusion & disadvantages |
| workfare programmes | evidence for decrease of vertical inequality | |
| | evidence for possibility of increased spatial inequalities | bad targeting increases deprivations for already job-deprived areas |
| | evidence for effective outcomes dependent on on prior material equalities | prior inequalities such as land ownership can lead to political capture and less effective policies |
| social protection | evidence for conditional cash transfers producing short- and long-term inequality reduction | production of short-term cash influx |
| | mixed evidence for childcare subsidies decreasing gender inequalities | |
| | evidence for stagnating income replacement rates exacerbating existing vertical inequalities | |
| | healthcare subsidy impacts strongly dependent on correct targeting | |
```{python}
findings_institutional = pd.read_csv("02-data/supplementary/findings-institutional.csv")
from src import prep_data
import math
validities = prep_data.calculate_validities(by_intervention)
valid_subset = validities[["internal_validity", "external_validity", "citation"]].fillna(1.0).drop_duplicates(subset=["citation"]).sort_values("internal_validity")
def combined_validities(df_in, column: str = "internal_validity"):
if not isinstance(df_in, str):
return
combined = 0.0
for study in df_in.split(";"):
new = valid_subset.loc[valid_subset["citation"] == study, column]
if len(new) > 0 and not math.isnan(new.iat[0]):
combined += new.iat[0]
if combined:
return combined
return 0.0
def combined_external(df_in, column: str = "external_validity"):
return combined_validities(df_in, column)
findings_institutional["internal_validity"] = findings_institutional["studies"].apply(combined_validities)
findings_institutional["external_validity"] = findings_institutional["studies"].apply(combined_external)
md(tabulate(findings_institutional[["area of policy", "internal_validity", "external_validity", "findings", "channels"]], showindex=False, headers="keys", tablefmt="grid"))
```
{{< landscape >}} {{< landscape >}}