We now test for . We compute the p-values,
and then construct a vector recording whether the th p-value is
less than or equal to , in which case we reject , or greater than ,
in which case we do not reject , for .
p.values<-rep(0,100)for(iin1:100){p.values[i]<-t.test(x[,i],mu=0)$p.value}decision<-rep("Do not reject H0",100)decision[p.values<=.05]<-"Reject H0"
Since this is a simulated data set, we can create a table similar to
Table 13.2.
> table(decision, c(rep("H0 is False", 50), rep("H0 is True", 50)))
decision H0 is False H0 is True
Do not reject H0 40 47
Reject H0 10 3
Therefore, at level , we reject just 10 of the 50 false null hypotheses,
and we incorrectly reject 3 of the true null hypotheses. Using the notation
from Section 13.3, we have , , , and . Note
that the rows and columns of this table are reversed relative to Table 13.2.
We have set , which means that we expect to reject around of
the true null hypotheses. This is in line with the table above, which
indicates that we rejected of the 50 true null hypotheses ().
Questions
MC1: In the simulation above, for the false null hypotheses, the ratio of the mean to the standard deviation was only .
This amounts to quite a weak signal, and it resulted in a high number of Type II errors.
If we instead simulate data with a stronger signal, so that the ratio of the mean to the standard deviation for the false null hypotheses equals (e.g. ), what would you expect to happen?
We would make more Type II errors.
We would make less Type II errors.
Changing the signal strength has no impact on the expected number of Type II errors.