Closed simonw closed 4 years ago
The United States Census Bureau has a CSV file for this: https://www2.census.gov/programs-surveys/popest/datasets/2010-2019/national/totals/nst-est2019-alldata.csv
From https://www.census.gov/data/datasets/time-series/demo/popest/2010s-state-total.html
I'm going to build my own cut-down version of that census file and check it into the repo.
I took the original file, deleted all of the columns except for REGION
, DIVISION
, STATE
, NAME
, POPESTIMATE2019
, then renamed those columns to the following:
Here's a query that attempts to calculate deaths-per-million for the most recently reported state daily numbers: https://covid-19.datasettes.com/covid?sql=select+date%2C+state%2C+fips%2C+cases%2C+deaths%2C+pop_estimate_2019%2C+1000000.0+*+deaths+%2F+pop_estimate_2019+as+deaths_per_million%0D%0Afrom+ny_times_us_states%0D%0Ajoin+us_census_state_populations_2019+on+state+%3D+state_name+%0D%0Awhere+%22date%22+%3D+%28select+max%28date%29+from+ny_times_us_states%29+order+by+deaths_per_million+desc
select date, state, fips, cases, deaths, pop_estimate_2019, 1000000.0 * deaths / pop_estimate_2019 as deaths_per_million
from ny_times_us_states
join us_census_state_populations_2019 on state = state_name
where "date" = (select max(date) from ny_times_us_states) order by deaths_per_million desc
Looking at deaths-per-head-of-population could help illustrate which states are doing better or worse.