Recently I have noticed that Type I error of a test is too much persistent. Even if all the values are almost equal (variance is extremely low) and tested to that value (true mean), still there is nearly 5% Type I error of the test. I am frightened and curious to rethink, are the people who have banned (or skeptic about) NHST (null hypothesis significance testing) truly correct?
Let's have a look at the following r code:
n=10000
t1err=0
set.seed(1235)
for (i in 1:n){
x=rnorm(100, 10, 20)
if (((t.test(x, mu=10))$p.value)<=0.05) (t1err=t1err+1)
}
cat("Type I error rate in percentage is", (t1err/n)*100,"%")
It will produce roughly 5% as Type I error. Seems ok. But let's see this:
n=10000
t1err=0
set.seed(1235)
for (i in 1:n){
x=rnorm(100, 10, 0.000001)
if (((t.test(x, mu=10))$p.value)<=0.05) (t1err=t1err+1)
}
cat("Type I error rate in percentage is", (t1err/n)*100,"%")
Each values are extremely close to 10. Still it produces about 5% Type I error. What conclusion we may draw from it? Or, am I missing something?