Public
Edited
Jun 16, 2023
1 fork
Insert cell
Insert cell
Insert cell
import {cea_functions, cell} from "@falk-lieder/cea_library"
Insert cell
import {cost_effectiveness_of_intervention_bs} from "@falk-lieder/cea-baumsteiger"
Insert cell
Insert cell
prosocialbehavioroverview1 = FileAttachment("ProsocialBehaviorOverview@1.png").image()
Insert cell
Insert cell
Insert cell
step1 = FileAttachment("Step1.png").image()
Insert cell
Insert cell
Insert cell
viewof P_g_new = cell(`p_g_new = p_g_old`, P_g_old)
Insert cell
Insert cell
viewof P_g_old = cell(`

p_g_old_mixture = mx(effects_shin_lee,effects_menting, additional_studies_mesurado, effect_baumsteiger, nr_interventions)
p_g_old = quantile(p_g_old_mixture,0.05) to quantile(p_g_old_mixture,0.95)

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

//Studies reviewed by Shin and Lee
nr_studies_shin_lee = 38
mean_shin_lee = 0.442
ci_shin_lee = [0.240, 0.644]
standard_error_shin_lee = (ci_shin_lee[1]-ci_shin_lee[0])/(2*1.96)
std_shin_lee = pow(nr_studies_shin_lee,1/2)*standard_error_shin_lee
effects_shin_lee = normal(mean_shin_lee,std_shin_lee)

//Effect size for the Incredible Years program reviewed by Menting et al.
effects_menting = normal_from_ci(0.15,0.31)

//Additional studies reviewed by Mesurado et al.
additional_studies_mesurado = mx(normal(0.058,0.278), normal(0.038,0.287), normal(0.679,0.152), normal(0.54,0.313))

//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.80
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)

effect_baumsteiger = normal(effect_size_estimate_baumsteiger,se_effect_size_estimate)


//The number of interventions covered by each of the three meta-analyses
nr_interventions = [33,1,4,1]

/*
g_max_mesurado1 = max(normal(0.058,0.278), normal(0.038,0.287))
g_max_mesurado2 = max(normal(0.679,0.152), normal(0.54,0.313))
g_max_mesurado = max(g_mesurado1,g_mesurado2)
g_max_menting_shin = max(normal(mean_shin_lee,std_shin_lee), effects_menting)
g_max_prosocial = max(g_max_mesurado, g_max_menting_shin)
*/

`, cea_functions,{distributionChartSettings: {showSummary: true}})
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 = p_g_new * std_freq_of_prosocial_behavior_in_acts_per_day

`, [P_g_new,cea_functions,std_freq_prosocial,half_life],{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_of_effect_on_prosocial_behavior_in_days)

`, [initial_freq_of_prosocial_behavior,half_life,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
viewof half_life = cell(`
half_life_mixture = mx(half_life_bs,half_life_caparara)

half_life_of_effect_on_prosocial_behavior_in_days = quantile(half_life_mixture,0.05) to quantile(half_life_mixture,0.95)

`, [half_life_bs_samples,half_life_caparara_samples],{distributionChartSettings: {showSummary: true}})
Insert cell
Insert cell
half_life_bs_json = FileAttachment("half_life_bs.json").json()
Insert cell
viewof half_life_bs_samples=cell(`half_life_bs=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 = cell(`

ce_new = cost_effectiveness(increase_in_happiness,cost_of_online_intervention_per_person_reached())

`, [cea_functions,wellbeing],{distributionChartSettings: {showSummary: true}})
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 = 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)

// 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 = normal_from_ci(50,138)

//ce_best_preexisting_intervention = max(ce_StrongMinds->SampleSet.fromDist, ce_new->SampleSet.fromDist) ce_best_preexisting_intervention = ce_StrongMinds // max(ce_StrongMinds,ce_prev_prosocial_behavior)

// 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,ce_StrongMinds,usd_deployable_to_new_intervention,cost_of_research)

net_effect_of_research_in_WELBY = hours_of_happiness_to_WELLBYs(net_effect_of_research_on_promoting_prosocial_purpose)

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

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 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


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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more