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
model | |
{ | |
# The model for each observational unit | |
# (each row is a subject's data point) | |
for( j in 1:N ) | |
{ | |
mu[j] <- beta[1] + beta[2] * ( so[j] ) + u[subj[j]] + w[item[j]] | |
rt[j] ~ dnorm( mu[j], tau.e ) | |
##change the above line to: | |
#rt[j] ~ dt(mu[j],tau.e, 2) |
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
newcomb <- | |
c(28,26,33,24,34,-44,27,16,40,-2, | |
29,22,24,21,25,30,23,29,31,19, | |
24,20,36,32,36,28,25,21,28,29, | |
37,25,28,26,30,32,36,26,30,22, | |
36,23,27,27,28,27,31,27,26,33, | |
26,32,32,24,39,28,24,25,32,25, | |
29,27,28,29,16,23) | |
# Data as a list |
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
> summary(lm<-lm(wear~material-1,BHHshoes)) | |
> X<-model.matrix(lm) | |
> 2.49^2*solve(t(X)%*%X) | |
materialA materialB | |
materialA 0.62001 0.00000 | |
materialB 0.00000 0.62001 |
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
> (lm.full<-lmer(wear~material-1+(1|Subject), data = BHHshoes)) | |
Linear mixed model fit by REML | |
Formula: wear ~ material - 1 + (1 | Subject) | |
Data: BHHshoes | |
AIC BIC logLik deviance REMLdev | |
62.9 66.9 -27.5 53.8 54.9 | |
Random effects: | |
Groups Name Variance Std.Dev. | |
Subject (Intercept) 6.1009 2.470 | |
Residual 0.0749 0.274 |
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
> b1.vals<-subset(BHHshoes,material=="A")$wear | |
> b2.vals<-subset(BHHshoes,material=="B")$wear | |
> | |
> vcovmatrix<-var(cbind(b1.vals,b2.vals)) | |
> | |
> covar<-vcovmatrix[1,2] | |
> sds<-sqrt(diag(vcovmatrix)) | |
> covar/(sds[1]*sds[2]) | |
b1.vals | |
0.98823 |
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
## 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 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 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 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 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: |