example
L1-female-birth-rate
2021-02-18
R package build
𝕎e are told that 241,945 girls and 251,527 boys were born in Paris from 1745 to 1770.
y = 241945 n = 241945 + 251527 posterior = function(theta) dbeta(theta,shape1 = y+1, shape2 = n- y + 1) curve(posterior,from = 0,to = 1, main=paste("n = ",n,"; y = …
Read more →
|
L1-miscel
2021-02-18
R package build
|
L1-theta-male
2021-02-18
R package build
𝕟 = 10 y = 8 likefun = function(theta) {theta^y * (1 - theta)^(n-y)} curve(likefun,from = 0,to = 1, main=paste("n = ",n,"; y = ",y),xlab="theta", ylab="likelihood") abline(v=y/n,col='gray') What if we got 10 heads?
n = 10 y = 10 likefun = …
Read more →
|
L3-Bonferroni
2021-02-18
R package build
𝕒lpha = 0.05 Patleastonemistake = function(m) {1 - (1-alpha)^m} curve(Patleastonemistake,from = 1, to=100, ylab="Prob at least one wrong", xlab="m = number of tests") grid() abline(h=1,col='gray')
Read more →
|
L3-Crohns-Additive
2021-02-18
R package build
|
L4-power
2021-02-18
R package build
𝕝ibrary(tidyverse) ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ── ## ✓ ggplot2 3.3.3 ✓ purrr 0.3.4 ## ✓ tibble 3.0.5 ✓ dplyr 1.0.3 ## ✓ tidyr 1.1.2 ✓ stringr 1.4.0 ## ✓ readr 1.4.0 ✓ forcats 0.5.0 ## ── Conflicts ────────────────────────────────────────── …
Read more →
|
L6-download-data
2021-02-18
R package build
𝕝ibrary(tidyverse) work.dir ="~/Downloads/hapmap/" ## qqunif function source("https://gist.githubusercontent.com/hakyim/38431b74c6c0bf90c12f/raw/21fbae9a48dc475f42fa60f0ef5509d071dea873/qqunif") Download plink for mac
## Download plink from https://www.cog-genomics.org/plink2 ## …
Read more →
|
L6-population-structure
2021-02-18
R package build
𝕝ibrary(tidyverse) ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ── ## ✓ ggplot2 3.3.3 ✓ purrr 0.3.4 ## ✓ tibble 3.0.5 ✓ dplyr 1.0.3 ## ✓ tidyr 1.1.2 ✓ stringr 1.4.0 ## ✓ readr 1.4.0 ✓ forcats 0.5.0 ## ── Conflicts ────────────────────────────────────────── …
Read more →
|
L8-LD-score
2021-02-18
R package build
|
L8 GRM shows population structure
2020-02-06
R package build
𝕝ibrary(tidyverse) work.dir ="~/Downloads/hapmap/" functions tileplot <- function(mat) { mat = data.frame(mat) mat$Var1 = factor(rownames(mat), levels=rownames(mat)) ## preserve rowname order melted_mat <- gather(mat,key=Var2,value=value,-Var1) melted_mat$Var2 = …
Read more →
|