This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## For password management | |
git config --global user.email "[email protected]" | |
git config --global user.name "Sam Abbott" | |
git config --global credential.helper cache | |
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git | |
# github settings | |
# developer settings | |
# create access token and copy | |
# git pull/push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nots %>% ggplot(aes(x = year, y = prop_decrease, col = prop_decrease)) + | |
geom_hline(yintercept = 0, linetype = 1, alpha = 0.5) + | |
geom_hline(yintercept = 0.09, linetype = 2, alpha = 0.5) + | |
geom_point(size = 2) + | |
scale_y_percent() + | |
geom_smooth(alpha = 0.2) + | |
scale_colour_viridis_c() + | |
theme_minimal() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
age_groups <- tibble(age_groups = c("15-19 years", | |
"20-24 years", "25-29 years"), key = 1) | |
nots_by_age <- nots %>% | |
mutate(key = 1) %>% | |
left_join(age_groups, by = "key") %>% | |
select(-key, -prev_year_m, -measure, -prop_decrease_sample) %>% | |
spread(key = "age_groups", value = "prop_decrease_sample") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cluster <- create_cluster(CORES) %>% | |
cluster_library(c("PACKAGE_NAME")) %>% | |
cluster_copy(CUSTOM_VARIABLE) | |
then use parition and collect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install.packages("devtools") | |
devtools::install_github("seabbs/getTBinR") | |
getTBinR::plot_tb_burden(metric = "e_inc_100k", countries = "United Kingdom", facet = "country", interactive = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Likelihood test p values for categorical variables | |
model_uni <- outcomes %>% map(function(.) model_outcome_uni(., variable = 'ageatvac', LRT = TRUE)) | |
model_adj <- outcomes %>% map(function(.) model_outcome_adj(., variable = 'ageatvac', LRT = TRUE)) | |
ageatvac_lrt_uni <- map2(model_ageatvac_uni, model_uni, function(x, y) pool.compare(x, y, data = imp_df, method = "likelihood")) %>% | |
map(function(x) ifelse(x < 0.001, "0.001", pretty_round(x, digits = 3))) | |
ageatvac_lrt_adj <- map2(model_ageatvac_adj, model_adj, function(x, y) pool.compare(x, y, data = imp_df, method = "likelihood")$pvalue) %>% | |
map(function(x) ifelse(x < 0.001, "0.001", pretty_round(x, digits = 3))) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install.packages("getTBinR") | |
library(getTBinR) | |
# install.packages("tidyverse") | |
library(tidyverse) | |
# Get the data | |
tb_burden <- get_tb_burden(download_data = TRUE, save = TRUE) | |
dict <- get_data_dict(download_data = TRUE, save = TRUE) | |
# Look up variables with mortality in their definition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install.packages("getTBinR") | |
library(getTBinR) | |
# install.packages("tidyverse") | |
library(tidyverse) | |
# Get the data | |
tb_burden <- get_tb_burden(download_data = TRUE, save = TRUE) | |
dict <- get_data_dict(download_data = TRUE, save = TRUE) | |
# Look up variables with mortality in their definition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install.packages("getTBinR") | |
library(getTBinR) | |
# install.packages("tidyverse") | |
library(tidyverse) | |
# install.packages("gridExtra") | |
library(gridExtra) | |
# Get the data | |
tb_burden <- get_tb_burden(download_data = TRUE, save = TRUE) | |
dict <- get_data_dict(download_data = TRUE, save = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FLOAT(SCRIPT_REAL("qbinom(0.001, .arg2, .arg1 / .arg2) / .arg2", | |
WINDOW_SUM(SUM([prob_Accepted]), -[No. of days for rolling average] + 1, 0), | |
WINDOW_SUM(COUNT([prob_Accepted]), -[No. of days for rolling average] + 1, 0))) |
OlderNewer