This file contains hidden or 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
| ### R code from vignette source '01_ADAIntroLecture.Rnw' | |
| ################################################### | |
| ### code chunk number 1: 01_ADAIntroLecture.Rnw:134-141 | |
| ################################################### | |
| ## load data: | |
| data<-read.table("~/Git/Statistics-lecture-notes-Potsdam/AdvancedDataAnalysis/data/gibsonwu2012data.txt",header=T) | |
| ## take reciprocal rt to normalize residuals: | |
| data$rrt<- -1000/data$rt | |
| ## define predictor x: |
This file contains hidden or 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
| ### R code from vignette source '02_ADALecture2.Rnw' | |
| ################################################### | |
| ### code chunk number 1: 02_ADALecture2.Rnw:66-72 | |
| ################################################### | |
| library(mvtnorm) | |
| u0 <- u1 <- seq(from = -3, to = 3, length.out = 30) | |
| Sigma1<-diag(2) | |
| f <- function(u0, u1) dmvnorm(cbind(u0, u1), mean = c(0, 0),sigma = Sigma1) | |
| z <- outer(u0, u1, FUN = f) |
This file contains hidden or 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
| ### R code from vignette source '03_ADALecture3.Rnw' | |
| ################################################### | |
| ### code chunk number 1: 03_ADALecture3.Rnw:85-92 | |
| ################################################### | |
| data<-read.table("~/Git/Statistics-lecture-notes-Potsdam/AdvancedDataAnalysis/data/gibsonwu2012data.txt",header=T) | |
| ## take reciprocal rt to normalize residuals: | |
| data$rrt<- -1000/data$rt | |
| ## define predictor x: | |
| data$x <- ifelse( |
This file contains hidden or 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
| ### R code from vignette source '04_ADALecture4.Rnw' | |
| ################################################### | |
| ### code chunk number 1: 04_ADALecture4.Rnw:67-72 | |
| ################################################### | |
| vpost<-function(v=0.2609^2,n=1,s=0.15^2){ | |
| return(1/((1/v)+n/s)) | |
| } | |
| n<-seq(1,1000,by=1) | |
| plot(n,vpost(v=2600,n=n),type="l",ylab="posterior variance",xlab="sample size") |
This file contains hidden or 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
| ## store proportion of false positives | |
| ## in one lifetime of 200 experiments: | |
| prop_fps<-rep(NA,1000) | |
| ## run k=1000 scientists, each with | |
| ## a lifetime of 200 experiments: | |
| for(k in 1:1000){ | |
| ## number of experiments for each scientist: | |
| nexp<-200 | |
| ## prob of sampling from a population | |
| ## where the null is true: |
This file contains hidden or 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
| ## Our simulated scientist will declare | |
| ## significance only if he/she gets | |
| ## 2 replications with p<0.05: | |
| stringent<-FALSE | |
| ## Set the above to FALSE if you want to | |
| ## have the scientist publish a single | |
| ## expt. as soon as it's significant: | |
| #stringent <- FALSE | |
| ## num of scientists to simulate: |
This file contains hidden or 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
| ### R code from vignette source 'recoveringcorrelationsV2.Rnw' | |
| ################################################### | |
| ### code chunk number 1: recoveringcorrelationsV2.Rnw:98-156 | |
| ################################################### | |
| new.df <- function(cond1.rt=487, effect.size=123, | |
| sdev=544, | |
| sdev.int.subj=160, sdev.slp.subj=195, | |
| rho.u=0.6, | |
| nsubj=37, |
This file contains hidden or 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
| <<>>= | |
| # n: no of operations | |
| # x: no of deaths | |
| # N: no of hospitals | |
| dat<-list(n=c(47,211,810,148,196,360,119,207,97, | |
| 256,148,215), | |
| x=c(0,8,46,9,13,24,8,14,8,29,18,31), | |
| N=12) | |
| cat("model |
This file contains hidden or 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
| “He seems to have a solid stats background back in the day” | |
| A lot of people claim a lot of things about themselves. I have met a lot of people who characterize themselves as “fluent in Japanese” (oddly, these are always Americans), where their actual on-the-ground fluency level is pretty laughable. | |
| I couldn’t find any clear statements about what his educational background is. He says on his linkedin page: “Facultés universitaires ‘Notre-Dame de la Paix’ Ph.D., Statistics, Mathematics, Science, 1983 – 1993″, Then he lists two courses he did there, “Stochastic Geometry, Markov Processes.” I find it odd that a guy does a PhD somewhere, over 10 years, and lists two courses under that PhD. | |
| Also, I searched for this mysterious uni I have never heard of: Facultés universitaires ‘Notre-Dame de la Paix. | |
| I ended up at a weird Jesuits page in Belgium: |
This file contains hidden or 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
| ## probable effect size derived from past studies: | |
| D<-15 | |
| ## SE from the study of interest: | |
| se<-46 | |
| stddev<-se*sqrt(37) | |
| nsim<-10000 | |
| drep<-rep(NA,nsim) | |
| for(i in 1:nsim){ | |
| drep[i]<-mean(rnorm(37,mean=D,sd=stddev)) | |
| } |