Public
Edited
Jun 17, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = {
const data = [];
const p = P/100;
for (let n = min_n; n < max_n; n+=Math.max(1,Math.floor(max_n/1000))) {
const mean = n*p;
const sd = Math.sqrt(p*(1-p)*n);
const ci = 1.96; // 95%
data.push({n: n, error: ci*sd/n, top: Math.min(n, mean+ci*sd)/n, bottom: Math.max(0, mean-ci*sd)/n});
}
return data;
}
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