With $H_{0}:\mu = 0$,
iter = 100
n = 500
# alpha, beta
a = .05 # b(0.5) = .95 (given in the question)
and $x{\sim}\mathcal{N}(0.5, \sigma)$, for arbitrary $\sigma{>}0$, we apply a statistical test to test $H_{0}$, and expect that
- 5 tests make a type-1 error, or
- 5 tests make a type-2 error, or
- 5 tests reject $H_{0}$?
These options are true/false statements. To check (1), I did
set.seed(1)
replicate(iter, t.test(rnorm(500, .5, 5))$p.value < a) |> sum()
## e.g. returns
# [1] 63
I noticed that the results are heavily dependent on the choice of $\sigma$, i.e. it is difficult to conclude something general for me. I think that neither (1.) nor (3.) are correct. How can one check (2.)?
iter
is intended to beiterations
? (2) Please display the output and explain what specifically you do not understand. (3) Neither 1., 2., nor 3. is a question, so what do you mean by "check (2.)?" $\endgroup$b(0.5) = 0.95
means? I ask in order to understand where you're stuck, and give you an explanation (though I find that Jeremy Miles' answer is good, it seems you're still stuck). $\endgroup$