I need to calculate the power of a t-test for
set.seed(1)
N=1000
mu=5
number.of.rejects=0
sd=1.2
first I want to calculate my number of rejects with:
for(i in 1:N){
x=rnorm(n=16,mean = mu,sd=1.2)
#calculate test size
t=(mean(x)-5)/(sd(x)/4)
number.of.rejects=number.of.rejects +(abs(t)>c)
}
but I do not know how to find my critical value c
when my test has the level 95%
below is Q