Published
Edited
Jul 23, 2020
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
FileAttachment("image@5.png").image()
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
md`### Obesity deaths
| notif_count | notifying_agency | ratio |
|-------------|--------------------------------------|--------------------|
| 15 | CHICAGO POLICE DEPARTMENT | 0.2 |
| 12 | RUSH UNIVERSITY MEDICAL CENTER | 0.27906976744186 |
| 6 | WEISS MEMORIAL HOSPITAL | 0.222222222222222 |
| 6 | INGALLS MEMORIAL HOSPITAL | 0.162162162162162 |
| 6 | UNIVERSITY OF CHICAGO MEDICAL CENTER | 0.157894736842105 |
| 5 | SAINT ANTHONY HOSPITAL | 0.333333333333333 |
| 5 | NORTHWESTERN MEMORIAL HOSPITAL | 0.294117647058824 |
| 5 | TRINITY HOSPITAL | 0.185185185185185 |
| 5 | MACNEAL HOSPITAL | 0.185185185185185 |
| 5 | SWEDISH HOSPITAL | 0.108695652173913 |
| 4 | JOHN H. STROGER JR. HOSPITAL | 0.133333333333333 |
| 4 | LOYOLA UNIVERSITY MEDICAL CENTER | 0.114285714285714 |
| 4 | SOUTH SUBURBAN HOSPITAL | 0.111111111111111 |
| 4 | ADVOCATE CHRIST MEDICAL CENTER | 0.0454545454545455 |
| 3 | SOUTH SHORE HOSPITAL | 0.1875 |
| 3 | SAINT ALEXIUS MEDICAL CENTER | 0.1875 |
| 3 | GOTTLIEB HOSPITAL | 0.176470588235294 |
| 3 | SAINT FRANCIS HOSPITAL | 0.0652173913043478 |
| 3 | LITTLE COMPANY OF MARY | 0.0588235294117647 |
| 3 | GLENBROOK HOSPITAL | 0.0454545454545455 |

select sq.notif_count, nq.notifying_agency, notif_count::float/nq.count::float as ratio from (select count(*) as notif_count, notifying_agency from corona_deaths where lower(secondary_cause) like '%obesity%' or lower(primary_cause) like '%obesity%' or lower(primarycause_linea) like '%obesity%' or lower(primarycause_lineb) like '%obesity%' group by notifying_agency order by notif_count desc) sq, (select count(*), notifying_agency from corona_deaths group by notifying_agency) nq where nq.notifying_agency = sq.notifying_agency and sq.notif_count >= 3order by sq.notif_count desc, ratio desc;`
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
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
color
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
import { select } from "@jashkenas/inputs"
Insert cell
Insert cell
Insert cell
align
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