Published
Edited
Sep 21, 2020
1 star
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
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
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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require('d3@5')
Insert cell
healthy_ratio = 100 - infected_ratio
Insert cell
fnr = 100 - tpr // the false negative rate is the opposite of the true positive rate
Insert cell
fpr = 100 - tnr // the false positive rate is the opposite of the true negative rate
Insert cell
positive_count = true_positive_count + false_positive_count
Insert cell
negative_count = true_negative_count + false_negative_count
Insert cell
infected_count = sample_size * (infected_ratio / 100)
Insert cell
healthy_count = sample_size * (healthy_ratio / 100)
Insert cell
true_positive_count = infected_count * (tpr / 100)
Insert cell
false_negative_count = infected_count * (fnr / 100)
Insert cell
true_negative_count = healthy_count * (tnr / 100)
Insert cell
false_positive_count = healthy_count * (fpr / 100)
Insert cell
function round(value, precision) {
precision = precision || 0;
return Math.round(value * Math.pow(10, precision)) / Math.pow(10, precision);
}
Insert cell
positive_rate = (tpr / 100) * (infected_ratio / 100) +
(fpr / 100) * (healthy_ratio / 100)
Insert cell
infected_positive_rate = ((tpr / 100) * (infected_ratio / 100)) / positive_rate
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