descarteslabs / DL-COVID-19

Mobility changes in response to COVID-19, provided by Descartes Labs
https://descarteslabs.com/mobility/
Creative Commons Attribution 4.0 International
145 stars 42 forks source link

How to get the mobility data for a whole state using the data available here? #10

Closed armsp closed 4 years ago

armsp commented 4 years ago

Here the mobility data has been provided at county level. On your website I can see graphs at state level too. I was wondering, since the mobility provided at county level is the median mobility, is there a way to aggregate them to get the mobility for the whole state.

Any idea would be really helpful.

wildcat47 commented 4 years ago

That is what the value of "1" for CORRECTION: admin_level specifies. It also corresponds to admin2 being blank.

armsp commented 4 years ago

@wildcat47 I understand that admin1 has the states mentioned, what I was wondering was that how do you aggregate the medians of constituents of a state to arrive at the median (or any representative) for the whole state ? What I am asking is -

Because I looked around and turns out both have some issues being the representatives of their constituents. Hope its clearer what I am asking now.

Perhaps you can just tell me what you have used to arrive at the state level trends. That would be fine too.

wildcat47 commented 4 years ago

Well, the sum of samples at the county level equals the samples at the state level, suggesting that they are taking a uniform random sample of the population within a given state. In other words, the state-level median is the median of all the data collected for a given state.

If the statistics provided were averages, then the state-level average would be a weighted average of the county-level averages. But there is no such way to estimate a population median from the subgroup medians. It is neither the median of the county medians nor the average of the county medians.

armsp commented 4 years ago

@wildcat47

In other words, the state-level median is the median of all the data collected for a given state.

Since we don't have the raw data in this repository, does this mean that we just cannot reproduce what Axios has done here per state - Screenshot_2020-07-20 How the coronavirus pandemic changed mobility habits, by state

For that I need the exact data that you have but not published in this repository. Is this the correct conclusion?

wildcat47 commented 4 years ago

I have no affiliation with Descartes Labs, but am a user of the data.

I don't see why you could not reproduce that chart. The chart is labeled "average mobility" but the article notes they used Descartes Lab's mobility index, which is the median value that they are reporting for each state. As I previously noted, the rows with admin_level==1 and admin2 blank correspond to the state's overall median.

armsp commented 4 years ago

Ohh... I finally understand it now. You are absolutely right. Gosh it took me some time to get it - despite seeing this pattern in reporting data before. Thank you so much, good sir!