Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = 200000; n = 5; x = rnorm(m*n, 100, 15)
- DTA = matrix(x, nrow=m); a = rowMeans(DTA); s = apply(DTA, 1, sd)
- plot(a, s, pch=".", xlab="Sample Mean", ylab="Sample SD")
- t = (a-100)*sqrt(n)/s; t.crit = qt(.975, n-1); cond = (abs(t) > t.crit)
- points(a[cond],s[cond], pch=".", col="red")
- pm = c(-1,1); abline(v=100+pm*1.96*15/sqrt(n), col="darkgreen", lwd=2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement