##### Estimating Power Curves ### Preamble source("http://rfs.kvasaheim.com/math322.R") library(VGAM) ### Power of t-test # Requires data from Normal ## Power when mu wrong pval = numeric() for(i in 1:1e4) { x = rnorm(15, m=1, s=1) pval[i] = t.test(x, m=0)$p.value } alpha=0.05 mean(pval