How to find the sample size for a level-$\alpha$-test?

76 Views Asked by At

Let $X_1,X_2,\ldots,X_n$ be normally distributed with known variance $\sigma^2 > 0$.

We test

$$H_0: \mu = \mu_0 \ \text{ and } \ H_A:\mu > \mu_0.$$

Let $\alpha, \beta \in (0,1)$ and $\delta$ be given such that $\alpha + \beta < 1$ and $\delta > 0$. How big has to be the sample size that under the common level-$\alpha$-test the power against $\mu = \mu_0 + \delta$ is at least $1-\beta$?

Remark: The "common level-$\alpha$-test" is given by the condition that for the critical area $K$ holds $P_{\theta_0}(X \in K) \le \alpha \Longleftrightarrow P_{\theta_0}(X \in K^C) \ge 1-\alpha$.

I do not know how to do this. I know what the power function and the level-$\alpha$-test are, but I do not see how I should use this here to compute a sample size. Could you help me?

1

There are 1 best solutions below

1
On BEST ANSWER

Comment: This is not a general answer to your question, but a bit of a hint that may help you get started. Maybe take @heropup's advice and review the definitions of significance level and power before you start.

A specific computation in Minitab statistical software for normal data with known $\sigma= 3$ is shown below. Suppose you want to test $H_0: \mu = 20$ vs. $H_a: \mu > 20$ at the 5% level of significance. Specifically, you want power $1-\beta = 0.8$ to detect a difference of $\delta = 1.$ That is, power 80% against the specific alternative is $\mu_a = 21.$

  Power and Sample Size 

1-Sample Z Test

Testing mean = null (versus > null)
Calculating power for mean = null + difference
α = 0.05  Assumed standard deviation = 3


            Sample  Target
Difference    Size   Power  Actual Power
         1      56     0.8      0.802222

After you solve your general problem, you can plug in my values for $\sigma,\delta,$ and power, to see if you get $n = 56.$ The following graph shows power for various values of $\delta.$

If you can't see how to solve the general problem, then try this specific version first---then generalize.

[Start by finding the critical region (rejection region) for a test at level $\alpha = 0.05.$ Then find $n$ that gives the critical region probability $0.8$ when $\mu=21.]$

enter image description here

Perhaps consider the following figure;

enter image description here

hdr="n = 46: Dist'ns Under Null (blue) and Alternative"
curve(dnorm(x, 20, 3/sqrt(46)), 18,23, lwd=2, col="blue", 
      ylab="Density", xlab="Sample Mean", main=hdr)
curve(dnorm(x, 21, 3/sqrt(46)), add=T, lwd=2, col="brown")
abline(h = 0, col="green2")
abline(v = qnorm(.95, 20, 3/sqrt(46)), lty="dotted")