pacman::p_load(
arrow, dplyr, ggplot2, data.table, broom, survival, splines, purrr, latex2exp, patchwork, tableone, lubridate)
cco_pm = arrow::read_parquet(
'Data/cco_synthetic.parquet') %>%
mutate(id = as.integer(id))
glimpse(cco_pm)
Rows: 36,393
Columns: 13
$ id <int> 8, 8, 8, 8, 18, 18, 18, 18, 21, 21, 21, 21, 21, 30, …
$ case <dbl> 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0…
$ date_control <date> 2015-07-04, 2015-07-11, 2015-07-18, 2015-07-25, 201…
$ date_event <dttm> 2015-07-18, 2015-07-18, 2015-07-18, 2015-07-18, 201…
$ Temperature_MA_07 <dbl> 25.157479, 26.654723, 27.834193, 26.476728, 5.590609…
$ RH_MA_07 <dbl> 56.29268, 56.55889, 63.31046, 78.44241, 39.37510, 41…
$ PM2.5_MA_01 <dbl> 49.64125, 71.13610, 59.45812, 61.66376, 42.55674, 63…
$ PM2.5_MA_02 <dbl> 51.20873, 69.57587, 61.56069, 61.54747, 51.69360, 72…
$ PM2.5_MA_03 <dbl> 52.53419, 69.62826, 62.17871, 60.31168, 59.29741, 81…
$ PM2.5_MA_04 <dbl> 50.22526, 69.04128, 62.92857, 60.95178, 63.24530, 82…
$ PM2.5_MA_05 <dbl> 50.45423, 67.57404, 64.49090, 61.53650, 65.97250, 85…
$ PM2.5_MA_06 <dbl> 54.99141, 65.71766, 65.11285, 61.19540, 74.70118, 84…
$ PM2.5_MA_07 <dbl> 57.36381, 64.22242, 65.32272, 60.85549, 81.05209, 79…
id case date_control date_event Temperature_MA_07 RH_MA_07
1: 8 0 2015-07-04 2015-07-18 25.157479 56.29268
2: 8 0 2015-07-11 2015-07-18 26.654723 56.55889
3: 8 1 2015-07-18 2015-07-18 27.834193 63.31046
4: 8 0 2015-07-25 2015-07-18 26.476728 78.44241
5: 18 1 2015-03-04 2015-03-04 5.590609 39.37510
---
36389: 101967 0 2019-05-28 2019-05-21 23.694810 43.10004
36390: 101975 0 2019-10-06 2019-10-27 18.622571 56.82667
36391: 101975 0 2019-10-13 2019-10-27 15.517046 74.24209
36392: 101975 0 2019-10-20 2019-10-27 13.168067 62.80148
36393: 101975 1 2019-10-27 2019-10-27 13.901184 61.54964
PM2.5_MA_01 PM2.5_MA_02 PM2.5_MA_03 PM2.5_MA_04 PM2.5_MA_05 PM2.5_MA_06
1: 49.64125 51.20873 52.53419 50.22526 50.45423 54.99141
2: 71.13610 69.57587 69.62826 69.04128 67.57404 65.71766
3: 59.45812 61.56069 62.17871 62.92857 64.49090 65.11285
4: 61.66376 61.54747 60.31168 60.95178 61.53650 61.19540
5: 42.55674 51.69360 59.29741 63.24530 65.97250 74.70118
---
36389: 24.23324 29.30652 33.04356 33.84328 34.94796 35.59586
36390: 22.31457 29.18031 32.21481 33.99911 35.63098 37.01669
36391: 35.99716 34.55549 32.92004 37.70209 39.71017 39.65420
36392: 78.43440 80.46264 77.49954 73.02039 65.72646 59.30752
36393: 50.84817 44.64038 54.94739 60.00659 63.58455 65.79182
PM2.5_MA_07
1: 57.36381
2: 64.22242
3: 65.32272
4: 60.85549
5: 81.05209
---
36389: 35.43058
36390: 38.24265
36391: 38.10932
36392: 56.35800
36393: 66.64737