Published
Edited
May 3, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
donation_size
Insert cell
Insert cell
Insert cell
sum= arr => arr.reduce((a,b) => a+b,0)
Insert cell
mean_transfer_efficiency = {
let totalMoneyTransfered = sum(
spending_data.map((transfer) => parseFloat(transfer["Money to Transfers"].replaceAll(",", "")))
);
let totalSpending = sum(
spending_data.map((transfer) => parseFloat(transfer["Total spending"].replaceAll(",", "")))
);
let efficiency = totalMoneyTransfered / totalSpending;

return efficiency;
}
Insert cell
nuno_guess_transfer_efficency_going_forward = "0.75 to 0.9"
Insert cell
cell(nuno_guess_transfer_efficency_going_forward)
Insert cell
transfer_efficiency = nuno_guess_transfer_efficency_going_forward
Insert cell
transfer_percentages = spending_data.map(x => parseFloat( x["Percentage on Transfers"]))
Insert cell
viewof bindings1 = partial(`transfer_efficiency = ${transfer_efficiency}
total_funding_available = $donation_size * transfer_efficiency`, {}, {donation_size: donation_size})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
household_size_data = FileAttachment("household size analysis - Family size by household.csv").csv()
Insert cell
household_sizes = household_size_data.map(x => parseFloat(x["Total household size"])).filter(x => x !== 0)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof log_increase_in_initial_consumption = partial(`duration_of_initial_consumption = 0.5 to 3
log_increase_in_initial_consumption = (log(amount_consumed / duration_of_initial_consumption + baseline_consumption, 2) - log(baseline_consumption, 2)) * duration_of_initial_consumption`, baseline_bindings)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// to do: check that squiggle is computing this directly.
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md`## Midline estimate: Doublings of consumption per dollar`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// to do: Consistent capitalization of Squiggle
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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