Skip to content

Instantly share code, notes, and snippets.

@medewitt
medewitt / paper_summary_template.Rmd
Last active November 18, 2019 14:16
paper summary template
---
title: "Paper summary"
date: "`r Sys.Date()`"
bibliography: my_bib.bib
---
# Paper:
## Author:
## Journal:
## Keywords:
@medewitt
medewitt / ws_qwi.R
Last active January 3, 2020 21:07
pulling QWI information for Winston Salem
library(tidyverse)
library(tidyqwi)
# see census.gov/population/estimates/metro-city/0312msa.txt
yearz <- 2009:2018
state <- 37
arguments <- data.frame(yearz, state)
@medewitt
medewitt / covid-mortality-rates.csv
Created March 21, 2020 21:29
covid-mortality rates
age_group pct_sympto_hospital pct_hosp_icu infection_fatality_ratio
0-9 0.00 0.05 0.00
10-19 0.00 0.05 0.00
20-29 0.01 0.05 0.00
30-39 0.03 0.05 0.00
40-49 0.05 0.06 0.00
50-59 0.10 0.12 0.01
60-69 0.17 0.27 0.02
70-79 0.24 0.43 0.05
80+ 0.27 0.71 0.09
@medewitt
medewitt / information.md
Created March 25, 2020 10:25
Contact Tracing and Severity

The Shenzhen CDC identified 391 SARS-CoV-2 cases from January 14 to February 12, 2020 and 1286 close contacts. We compare cases identified through symptomatic surveillance and contact tracing, and estimate the time from symptom onset to confirmation, isolation, and hospitalization. We estimate metrics of disease transmission and analyze factors influencing transmission risk.

Cases were older than the general population (mean age 45) and balanced between males (187) and females (204). Ninety-one percent had mild or moderate clinical severity at initial assessment. Three have died, 225 have recovered (median time to recovery is 21 days). Cases were isolated on average 4.6 days after developing symptoms; contact tracing reduced this by

@medewitt
medewitt / grow-sda2.sh
Created April 17, 2020 15:10
grow filesystem after re-partition on centos 7 box
sudo xfs_growfs -d /
@medewitt
medewitt / icl_model.R
Created April 28, 2020 10:42
wrapping Imperial College
#' Stan Model Base General
#'
#' @param dat the dat sent to the model
#' @param iter 2400
#' @param warmup 1000
#' @param chains 4
#' @param control default controls
#' @param ... Arguments passed to `rstan::sampling` (e.g. iter, chains).
#' @return An object of class `stanfit` returned by `rstan::sampling`
#' @export
@medewitt
medewitt / compartment-viz-functions.R
Created May 4, 2020 09:47
Visualize compartment summaries from odin
library(data.table)
library(tidyverse)
path_seirds_model <- system.file("examples/discrete_stochastic_seirds.R", package = "odin")
seirds_generator <- odin::odin(path_seirds_model)
x <- seirds_generator()
x_res <- as.data.frame(replicate(100, x$run(0:365)[, -1]))
@medewitt
medewitt / risk-model.R
Created May 13, 2020 21:27
modelling-outbreak-risk
library(tidyverse)
n.sim <- 1000
lambda <- 8/45 # 8 nursing homes in 45 days
set.seed(336)
n.sim <- 1000
mu <- 20 # 20 hospitalizations mean
sigma <- 5 ## =/- 10 patients
sigma.sq <- sigma^2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.