Insert cell
Insert cell
Insert cell
import {cea_functions, cell} from "@falk-lieder/cea_library"
Insert cell
Insert cell
interventionPathwayToImpact1 = FileAttachment("Intervention Pathway to Impact.png").image()
Insert cell
Insert cell
Insert cell
step2 = FileAttachment("Step2.png").image()
Insert cell
Insert cell
viewof initial_freq_of_prosocial_behavior = cell(`

initial_increase_in_freq_of_prosocial_behavior_per_day = immediate_effect * std_freq_of_prosocial_behavior_in_acts_per_day

`, [effect_sizes,cea_functions,std_freq_prosocial,half_life_bs_samples],{distributionChartSettings: {showSummary: true}})
Insert cell
Insert cell
viewof effect_sizes = cell(`

//mean scores on the self-report measure of prosocial behavior.
//m stands for mean, post stands for post-test, pre stands for pre-test, t stands for the treatment group, c stands for the control group
m_post_t =4.8
m_pre_t = 4.08
m_post_c = 4.84
m_pre_c = 4.62

//standard deviations of the pre-test scores
sd_pre_t = 1.28
sd_pre_c = 1.41

// number of participants in the treatment group (n_t) and the control group (n_c)
n_t = 43
n_c = 32

// correlation between pre-test scores and post-test scores
rho = 0.47

effect_size_estimate_baumsteiger = effect_size_ppc(m_post_t,m_pre_t,m_post_c,m_pre_c,sd_pre_t,sd_pre_c,n_t,n_c)
se_effect_size_estimate = se_effect_size_ppc(m_post_t,m_pre_t,m_post_c,m_pre_c,sd_pre_t,sd_pre_c,n_t,n_c,rho)

immediate_effect = normal(effect_size_estimate_baumsteiger,se_effect_size_estimate)


`, cea_functions,{distributionChartSettings: {showSummary: true}})
Insert cell
Insert cell
viewof effect_on_prosocial_behavior = cell(`

increase_in_nr_acts_of_kindness_per_person =
sum_over_time(initial_increase_in_freq_of_prosocial_behavior_per_day,half_life)

`, [initial_freq_of_prosocial_behavior,half_life_bs_samples,cea_functions],{distributionChartSettings: {showSummary: true}})
Insert cell
Insert cell
Insert cell
viewof std_freq_prosocial = cell(`

// estimate of the standard deviation reported in the article
std_estimate = 1.64
n=77

std_freq_of_prosocial_behavior_in_acts_per_day = p_std_from_estimate(std_estimate,n)

`,cea_functions)
Insert cell
Insert cell
Insert cell
half_life_bs_json = FileAttachment("half_life_bs.json").json()
Insert cell
viewof half_life_bs_samples=cell(`half_life = SampleSet.fromList($half_life_bs)`,undefined,{jsImports: {half_life_bs: half_life_bs_json}, distributionChartSettings: {showSummary: true}})
Insert cell
half_lifeCaparara = FileAttachment("half_life.caparara.json").json()
Insert cell
viewof half_life_caparara_samples=cell(`half_life_caparara=SampleSet.fromList($half_life)`,undefined,{jsImports: {half_life: half_lifeCaparara}, distributionChartSettings: {showSummary: true}})
Insert cell
Insert cell
step31 = FileAttachment("Step3@1.png").image()
Insert cell
Insert cell
viewof wellbeing = cell(`

increase_in_happiness = increase_in_nr_acts_of_kindness_per_person * benefit_of_one_kind_act()

`
,[effect_on_prosocial_behavior,cea_functions],{distributionChartSettings: {showSummary: true}})
Insert cell
Insert cell
Insert cell
viewof cost_effectiveness_of_intervention_bs = cell(`

//cost-effectiveness in hours of happiness per dollar spent on its deployment
ce_new_bs_hh = cost_effectiveness(increase_in_happiness,cost_of_online_intervention_per_person_reached())

//cost-effectiveness in WELLBYs/1000$
ce_new_bs_WELLBYs_per_1000USD = 1000*hours_of_happiness_to_WELLBYs(ce_new_bs_hh)


`, [cea_functions,wellbeing],{distributionChartSettings: {showSummary: true}})
Insert cell
Insert cell
viewof comparison = cell(`

{distributions: [{name: "GiveDirectly", distribution: ce_GiveDirectly_WELLBYs}, {name:"Deworming", distribution: ce_deworming_WELLBYs}, {name: "StrongMinds", distribution: ce_StrongMinds_WELLBYs}, {name:"Anti-Malaria Foundation", distribution: ce_AMF_WELLBYs}, {name:"Prosocial Purpose", distribution: ce_new_bs_WELLBYs_per_1000USD}]}


`, [ce_of_previous_interventions, cost_effectiveness_of_intervention_bs],{distributionChartSettings: {showSummary: true}})
Insert cell
Insert cell
cell(`

prob_new_intervention_more_cost_effective_than_StrongMinds=1-cdf(ce_new_bs_WELLBYs_per_1000USD-ce_StrongMinds_WELLBYs,0)

`, [ce_of_previous_interventions, cost_effectiveness_of_intervention_bs])
Insert cell
Insert cell
viewof ce_of_previous_interventions = cell(`

// Cost-Effectiveness of Strong Mind's task-shifted group CBT for perinatal depression
// for women in developing countries, according to McGuire & Plant (2021).
ce_StrongMinds_SD_per_1000USD = 8.2 to 24
ce_StrongMinds_WELLBYs = sd_to_WELLBY(ce_StrongMinds_SD_per_1000USD)

ce_GiveDirectly_sd_years_per_1000USD = 0.278 to 1.77//1000/1170*normal_from_ci(0.077,0.121)
ce_GiveDirectly_WELLBYs = sd_to_WELLBY(ce_GiveDirectly_sd_years_per_1000USD)

ce_deworming_WELLBYs = normal(mean(8.67*ce_GiveDirectly_WELLBYs),(180+175)/(2*1.96))

ce_AMF_WELLBYs = 89.63-uniform(1,5)*(89.63-5.94)/5 //min(5,max(0,to(0.5,5)->SampleSet.fromDist))

ce_best_preexisting_intervention_hh = sd_years_per_1000USD_to_hh_per_dollar(ce_StrongMinds_SD_per_1000USD)

`, [cost_effectiveness_of_intervention_bs,cea_functions],{distributionChartSettings: {showSummary: true}})
Insert cell
Insert cell
Insert cell
Insert cell
viewof cost_effectiveness_of_research = cell(`

//How cost-effective would it be to conduct this research?
cost_effectiveness_of_research = cost_effectiveness(net_effect_of_research_on_promoting_prosocial_purpose,cost_of_research)

`, [benefit_of_research,cost_of_research,cea_functions],{distributionChartSettings: {showSummary: true}})
Insert cell
Insert cell
viewof cost_of_research = cell(`

// cost of the research and R&D project's required to develop a new intervention in USD
cost_of_research = 40k to 50k //250000 to 1.5M

`,undefined,{distributionChartSettings: {showSummary: true, tickFormat: "$,f"}, })
Insert cell
Insert cell
viewof benefit_of_research = cell(`

// total amount of money that will be invested into the cause area of promoting well-being according to EA principles
budget = 10M to 1B

// How much money would be invested into the new intervention if were is superior?
usd_deployable_to_new_intervention = investment_in_new_intervention(scalability_in_usd,budget,cost_of_research)

// What would be the research's net effect on the total well-being of humanity?
net_effect_of_research_on_promoting_prosocial_purpose = net_effect_of_research(ce_new_bs_hh,ce_best_preexisting_intervention_hh,usd_deployable_to_new_intervention,cost_of_research)

net_effect_in_WELLBYs = hours_of_happiness_to_WELLBYs(net_effect_of_research_on_promoting_prosocial_purpose)

`,[cost_effectiveness_of_intervention_bs,cea_functions,cost_of_research,scalability,ce_of_previous_interventions],{distributionChartSettings: {showSummary: true}})

Insert cell
Insert cell
Insert cell
Insert cell
viewof scalability = cell(`

//The target group of the new intervention is emerging adults.
//We assume that this corresponds to people of ages 15 to 35. We estimate that this
//demographic constitutes between 50% and 70% of all active internet users.
//source: https://www.statista.com/statistics/272365/age-distribution-of-internet-users-worldwide/
proportion_internet_users_between_15_and_35 = 0.5 to 0.7

// What is the maximal amount of money that the intervention could absorb?
scalability_in_usd = scalability_of_online_interventions(proportion_internet_users_between_15_and_35)


`, [cea_functions],{distributionChartSettings: {showSummary: true}})
Insert cell
Insert cell
viewof beneft_per_time = cell(`

person_years = 0.5 to 0.7
workweeks_per_year = 48 to 50
hours_per_week = 30 to 60
time_worked_on_project = person_years * workweeks_per_year * hours_per_week
value_per_hour = cost_effectiveness(net_effect_of_research_on_promoting_prosocial_purpose,time_worked_on_project)

welby_per_hour = hours_of_happiness_to_WELLBYs(value_per_hour)
`, [benefit_of_research, cea_functions])
Insert cell
viewof ce_ratio = cell(`

//How does the cost-effectiveness of this research compare to the cost-effectiveness of the best existing intervention?
cost_effectiveness_ratio = cost_effectiveness_of_research / ce_best_preexisting_intervention_hh

`, [cost_effectiveness_of_research,benefit_of_research,ce_of_previous_interventions],{distributionChartSettings: {showSummary: true}})
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more