Skip to content

Commit

Permalink
Add significant numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
tnauss committed Sep 26, 2020
1 parent 7f0e633 commit 54adf54
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1,310 deletions.
9 changes: 3 additions & 6 deletions src/depricated/pm_covid_publication_DE.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ figure_cntry_avg <- ggplot() +
scale_x_datetime(date_labels = "%d.%m, %a", date_breaks = "2 day", date_minor_breaks = "1 day") +
scale_color_manual(
values = c("#4f4f4f", "#b2df8a", "#1f78b4", "#a6cee3"),
labels = c(paste0("Daily median ", pm), paste0("Daily averaged median ", pm), "Daily new cases",
"Daily new cases, explained by time")
labels = c(paste0("Daily median ", pm), paste0("Daily averaged median ", pm), "Daily new cases", "Daily new cases, explained by time")
) +
theme(
text = element_text(size = 10), axis.title = element_text(size = 10),
Expand Down Expand Up @@ -192,7 +191,6 @@ This analysis part is based on individual rural district data. A mixed effect GA
# Compile model(s) or load precomputed ones.
cntry_indv <- cmpldata$de_clstr$clstr
mlm <- "gamm"
# frml = "new_cases ~ s(date_seq) + weekday + pm_median_lag + offset(pop_total_log10)"
frml <- "new_cases ~ s(date_seq) + weekday + pm_median_lag"
Expand Down Expand Up @@ -300,7 +298,7 @@ add_info$difftime_max_shutdown <- difftime(add_info$date_max, as.POSIXct("2020-0
tmp <- cntry_indv[cntry_indv$date <= as.POSIXct("2020-04-01"), ]
cntry_agg <- aggregate(st_drop_geometry(tmp[lag_var]), by = list(tmp$nuts3Code), FUN = mean)
cntry_agg <- aggregate(tmp[lag_var], by = list(tmp$nuts3Code), FUN = mean)
colnames(cntry_agg) <- c("nuts3Code", "PM_tavrg")
tmp <- tmp[tmp$date == as.POSIXct("2020-04-01"), ]
Expand All @@ -314,8 +312,7 @@ cntry_agg$st_area_log10 <- log10(cntry_agg$st_area)
# Test of the long-term correlation between PM and SARS-CoV2 infections
tavrg <- cntry_agg[, c("cases_log10", "centroid_lat", "centroid_lon", "pop_total_log10", "st_area_log10",
"difftime_first_shutdown", "PM_tavrg_log10")]
tavrg <- cntry_agg[, c("cases_log10", "centroid_lat", "centroid_lon", "pop_total_log10", "st_area_log10", "difftime_first_shutdown", "PM_tavrg_log10")]
lm_tavrg <- lm(cases_log10 ~ PM_tavrg_log10 + centroid_lat + centroid_lon +
pop_total_log10 + st_area_log10 + difftime_first_shutdown, data = tavrg)
Expand Down
Loading

0 comments on commit 54adf54

Please sign in to comment.