Skip to content

Commit

Permalink
Fixed stay at home order coding
Browse files Browse the repository at this point in the history
  • Loading branch information
nabarunDG committed Apr 22, 2020
1 parent 9374c0b commit 21fa805
Show file tree
Hide file tree
Showing 10 changed files with 1,251 additions and 1,098 deletions.
2,262 changes: 1,203 additions & 1,059 deletions .ipynb_checkpoints/locationcovid_exploratory-checkpoint.ipynb

Large diffs are not rendered by default.

Binary file modified addlmeasures.dta
Binary file not shown.
Binary file modified analysiset.dta
Binary file not shown.
Binary file modified covidchrdetail.dta
Binary file not shown.
10 changes: 8 additions & 2 deletions data_formatting.do
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import excel using "https://seer.cancer.gov/seerstat/variables/countyattribs/Rur
destring oldfips, g(temp)
gen fips=oldfips if temp>10000
replace fips="0"+oldfips if temp<10000
drop temp oldfips
drop temp oldfips C

destring rucc, force replace
save rucc, replace
Expand Down Expand Up @@ -212,7 +212,13 @@ import excel "2019_County_Health_Rankings_Data_v3.xls", sheet("Ranked Measure Da
by county: egen last3_m50=mean(m50) if weekdays >= lastweekday-2 & weekdays!=.
by county: egen last3_sample=total(samples) if weekdays >= lastweekday-2 & weekdays!=.
by county: egen last3_index=mean(m50_index) if weekdays >= lastweekday-2 & weekdays!=.


di "Samples from baseline period February 17 to March 7, 2020:"
qui: su samples if date>=mdy(2,17,2020) & date<= mdy(3,7,2020)
di r(sum)



collapse (max) last3_m50 last3_index last3_sample (sum) samples, by(fips county)

la var last3_m50 "Median km traveled (last 3 weekdays)"
Expand Down
Binary file modified dl_x_valid.dta
Binary file not shown.
Binary file modified dlmobility.dta
Binary file not shown.
Binary file modified google_x_valid.dta
Binary file not shown.
77 changes: 40 additions & 37 deletions locationcovid_exploratory.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
},
{
"cell_type": "code",
"execution_count": 52,
"execution_count": 22,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Notebook generated on 21 Apr 2020 at 21:55:46 ET\n"
"Notebook generated on 22 Apr 2020 at 08:51:49 ET\n"
]
}
],
Expand All @@ -64,7 +64,7 @@
},
{
"cell_type": "code",
"execution_count": 53,
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -170,7 +170,7 @@
},
{
"cell_type": "code",
"execution_count": 54,
"execution_count": 24,
"metadata": {},
"outputs": [
{
Expand All @@ -179,33 +179,33 @@
"text": [
"\n",
"\n",
" RUCC_2013 | Freq. Percent Cum.\n",
" rucc | Freq. Percent Cum.\n",
"------------+-----------------------------------\n",
" 1 | 342 16.12 16.12\n",
" 2 | 308 14.52 30.65\n",
" 3 | 275 12.97 43.61\n",
" 4 | 165 7.78 51.39\n",
" 5 | 74 3.49 54.88\n",
" 6 | 444 20.93 75.81\n",
" 7 | 321 15.13 90.95\n",
" 8 | 98 4.62 95.57\n",
" 1 | 345 16.27 16.27\n",
" 2 | 309 14.58 30.85\n",
" 3 | 273 12.88 43.73\n",
" 4 | 171 8.07 51.79\n",
" 5 | 76 3.58 55.38\n",
" 6 | 436 20.57 75.94\n",
" 7 | 322 15.19 91.13\n",
" 8 | 94 4.43 95.57\n",
" 9 | 94 4.43 100.00\n",
"------------+-----------------------------------\n",
" Total | 2,121 100.00\n",
" Total | 2,120 100.00\n",
"\n",
"\n",
"Distancing: |\n",
" Lowest (1) |\n",
" to Highest |\n",
" (5) | Freq. Percent Cum.\n",
"------------+-----------------------------------\n",
" 1 | 424 19.99 19.99\n",
" 2 | 424 19.99 39.98\n",
" 3 | 423 19.94 59.92\n",
" 4 | 421 19.85 79.77\n",
" 5 | 429 20.23 100.00\n",
" 1 | 421 19.86 19.86\n",
" 2 | 422 19.91 39.76\n",
" 3 | 423 19.95 59.72\n",
" 4 | 429 20.24 79.95\n",
" 5 | 425 20.05 100.00\n",
"------------+-----------------------------------\n",
" Total | 2,121 100.00\n",
" Total | 2,120 100.00\n",
"\n",
"\n",
"-------------------------\n",
Expand All @@ -215,41 +215,41 @@
"Highest |\n",
"(5) | sum(last3_~e)\n",
"----------+--------------\n",
" 1 | 1040479\n",
" 2 | 1481200\n",
" 3 | 2215266\n",
" 4 | 2649145\n",
" 5 | 6218575\n",
" 1 | 997370\n",
" 2 | 1442412\n",
" 3 | 2242183\n",
" 4 | 2907797\n",
" 5 | 5823421\n",
"-------------------------\n",
"\n",
"\n",
" Variable | Obs Mean Std. Dev. Min Max\n",
"-------------+---------------------------------------------------------\n",
"last3_sample | 2,121 6414.269 15083.38 101 285845\n",
"last3_sample | 2,120 6326.973 14928.19 101 285845\n",
"\n",
"Total 3-day mobile traces: 13604665\n",
"Total 3-day mobile traces: 13413183\n",
"\n",
"\n",
"\n",
"scalars:\n",
" r(N) = 2121\n",
" r(sum_w) = 2121\n",
" r(mean) = 42.09311648764907\n",
" r(Var) = 559.3349218681501\n",
" r(sd) = 23.65026261731886\n",
" r(N) = 2120\n",
" r(sum_w) = 2120\n",
" r(mean) = 42.10385226161694\n",
" r(Var) = 556.9398589649319\n",
" r(sd) = 23.59957327929748\n",
" r(min) = 0\n",
" r(max) = 378.3333435058594\n",
" r(sum) = 89279.50007030368\n",
" r(sum) = 89260.1667946279\n",
"\n",
"invalid 'format' \n"
"variable last3_samples not found\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"r(198);\n",
"r(198);\n"
"r(111);\n",
"r(111);\n"
]
},
{
Expand All @@ -276,7 +276,10 @@
" return list\n",
"\n",
"* Mean mobility change by quintile\n",
"table iso5, c(count last3_index mean last3_index sem last3_index sum samples), format(%10.0g) \n",
"table iso5, c(count last3_index mean last3_index sem last3_index sum samples median last3_sample) \n",
"\n",
"* Mean mobility change by status of homeorder\n",
"table homeorder, c(mean last3_index sem last3_index)\n",
"\n",
"* Rurality/urbanicity by quintile\n",
"table iso5, c(median rucc)"
Expand Down
Binary file modified rucc.dta
Binary file not shown.

0 comments on commit 21fa805

Please sign in to comment.