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
x <- structure(list(id = 1:240, trt = c(1, 1, 1, 1, 1, 1, 1, 1, 1, | |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
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
library(faux) | |
library(tidyverse) | |
set.seed(1) | |
b0 <- 2 | |
b1 <- 0.2 | |
# simulate data | |
n_leader <- 4 # number of facilitators |
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
# Durham Public Schools publishes a COVID-19 "dashboard" | |
# https://docs.google.com/spreadsheets/d/1kQ35JKpk3vNaM7ZfFK2DFb1B9kQIQ4IODr7lOM394nQ/edit#gid=769268401 | |
# Code by @ericpgreen | |
# load | |
library(tidyverse) | |
library(googlesheets4) | |
gs4_deauth() | |
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
example_smaller <- structure(list(level3_code = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, | |
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, | |
27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, | |
43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, | |
59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, | |
75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, | |
91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, | |
105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, | |
118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, | |
131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, |
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
\documentclass[justified,twoside,symmetric,]{tufte-book} | |
% ams | |
\usepackage{amssymb,amsmath} | |
\usepackage{ifxetex,ifluatex} | |
\usepackage{fixltx2e} % provides \textsubscript | |
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex | |
\usepackage[T1]{fontenc} | |
\usepackage[utf8]{inputenc} |
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
\documentclass[justified,twoside,symmetric,]{tufte-book} | |
% ams | |
\usepackage{amssymb,amsmath} | |
\usepackage{ifxetex,ifluatex} | |
\usepackage{fixltx2e} % provides \textsubscript | |
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex | |
\usepackage[T1]{fontenc} | |
\usepackage[utf8]{inputenc} |
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
\documentclass[a4paper,]{tufte-book} | |
% ams | |
\usepackage{amssymb,amsmath} | |
\usepackage{ifxetex,ifluatex} | |
\usepackage{fixltx2e} % provides \textsubscript | |
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex | |
\usepackage[T1]{fontenc} | |
\usepackage[utf8]{inputenc} |
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
covid <- structure(list(Province_State = c("Arizona", "Arizona", "Arizona", | |
"Arizona", "Arizona", "Arizona", "Arizona", "Arizona", "Arizona", | |
"Arizona", "Arizona", "Arizona", "Arizona", "Arizona", "Arizona", | |
"Arizona", "Arizona", "Arizona", "Arizona", "Arizona", "Arizona", | |
"Arizona", "Arizona", "Arizona", "Arizona", "Arizona", "Arizona", | |
"Arizona", "Arizona", "Arizona", "Arizona", "Arizona", "Arizona", | |
"Arizona", "Arizona", "Arizona", "Arizona", "Arizona", "Arizona", | |
"Arizona", "Arizona", "Arizona", "Arizona", "Arizona", "Arizona", | |
"Arizona", "Arizona", "Arizona", "Arizona", "Arizona", "Arizona", | |
"Arizona", "Arizona", "Arizona", "Arizona", "Arizona", "Arizona", |
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
# MRP for non-representative samples | |
# http://research.nivi.io/posts/2020-12-08-mister-p-helps-us-understand-vaccine-hesitancy/ | |
# Eric Green (adapted from https://www.monicaalexander.com/posts/2019-08-07-mrp/) | |
# load packages | |
library(tidyverse) | |
library(ggtext) | |
library(brms) | |
library(tidybayes) | |
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
library(simstudy) | |
k = 0 | |
ppv <- data.frame(sim=NULL, r=NULL, outcome=NULL, ppv=NULL) | |
corr <- c(0.1, 0.4) | |
x <- seq(0.1, 0.5, by=0.1) | |
y <- 1-x | |
for (s in 1:1000) { |
NewerOlder