# Power for a mean difference of two independent groups

1. Jan 31, 2015

### FredericChopin

1. The problem statement, all variables and given/known data

"The Daily Planet ran a recent story about Kryptonite poisoning in the water supply after a recent event in Metropolis. Their usual field reporter, Clark Kent, called in sick and so Lois Lane reported the stories. Researchers plan to sample 288 individuals from Metropolis and control city Gotham and will compare mean blood Kryptonite levels (in Lex Luthors per milliliter, LL/ml). The expect to find a mean difference in LL/ml of around 2. Assoming a two sided Z test of the relevant hypothesis at 5%, what would be the power. Assume that the standard deviation is 12 for both groups.

* Around 60%
* Around 20%
* Around 80%
* Around 70%
* Around 50%
* Around 90%
* Around 40%
* Around 10%
* Around 30%"

2. Relevant equations

I'm not sure, but here's what I think:

Z-statistic for a mean difference of two independent groups (I hope this is correct):

$$\frac{\mu_x - \mu_y}{\sqrt{\frac{{\sigma_x}^2}{n_x} + \frac{{\sigma_y}^2}{n_y}}}$$

3. The attempt at a solution

After trying and getting it wrong twice, I am on my third and last attempt to answer this question. Previously, I answered "80%" and then "90%", but they were wrong.

What I'm having problems with is constructing a two-sided power calculation. I don't know how to do that.

What I at least know, however, is how to do a one-sided power calculation:

$$1 - \beta = P ( Z > z_{1 - \alpha} - \frac{\mu_a - \mu_0}{\sigma / \sqrt{n}} | \mu = \mu_a)$$

This is correct, right? Well, I thought maybe for a one-sided power for a mean difference of two independent groups, it would be:

$$1 - \beta = P ( Z > z_{1 - \alpha} - \frac{\mu_a - \mu_0}{\sqrt{\frac{{\sigma_x}^2}{n_x} + \frac{{\sigma_y}^2}{n_y}}})$$

Is this correct?

I don't know how to do a two-sided power calculation though.

Can anyone help me?

Thank you.

2. Feb 1, 2015

### O_o

One thing I noticed right away is that you're confusing the unknown population means with the sample means that can be calculated by doing the survey. The symbol "mu" always refers to the unknown population means while the symbol x with a bar over it represents the mean you get from your sample.

Let's start from basics and think things through very methodically. The first step is to find the critical region under which we reject the null hypothesis. Our null hypothesis is $$H_o: \mu_1 - \mu_2 = 0$$
Which says that the two unknown population means are equal.

We're doing a Z-test, so our test statistic is
$$\frac{\left(\bar{x_1} - \bar{x_2}\right) - \left(\mu_1 - \mu_2\right)}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}$$ Under the null hypothesis his turns into$$\frac{\left(\bar{x_1} - \bar{x_2}\right)}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}$$ Which has a normal distribution with mean 0 and standard deviation 1.

We're doing a two-sided Z-test with a probability of rejecting the null hypothesis when it's true of 5%. Since it's two-sided we will reject the upper 2.5% of values and the lower 2.5% of values. This means we reject in these 2 situations: $$\frac{\left(\bar{x_1} - \bar{x_2}\right)}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}\gt z_{0.025} = 1.96 \\ \frac{\left(\bar{x_1} - \bar{x_2}\right)}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}\lt -z_{0.025} = -1.96$$ The value 1.96 can be found by looking on a Z-score table.

From this you can see that we reject the null hypothesis when the difference of our sample means is $$\left(\bar{x_1} - \bar{x_2}\right) \gt 1.96 \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}} \\ \left(\bar{x_1} - \bar{x_2}\right) \lt -1.96 \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}$$

So now we know the rejection regions. The power of a test is the probability of rejecting the null hypothesis when the alternative hypothesis is true. In the question it states we're expecting a difference of 2. So our alternative hypothesis is $$H_a: \mu_1 - \mu_2 = 2$$
Remember our test statistic is
$$\frac{\left(\bar{x_1} - \bar{x_2}\right) - \left(\mu_1 - \mu_2\right)}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}$$ Under the alternative hypothesis his turns into$$\frac{\left(\bar{x_1} - \bar{x_2}\right) - 2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}$$ Which has a normal distribution with mean 0 and standard deviation 1.

So now we look at our rejection regions
$$\left(\bar{x_1} - \bar{x_2}\right) \gt 1.96 \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}} \\ \left(\bar{x_1} - \bar{x_2}\right) \lt -1.96 \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}$$
We can rearrange them so that they look like
$$\frac{\left(\bar{x_1} - \bar{x_2}\right) - 2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}} \gt 1.96 - \frac{2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}} \\ \frac{\left(\bar{x_1} - \bar{x_2} \right) - 2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}} \lt -1.96 - \frac{2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}$$

Remembering that under the alternative hypothesis, the left side is a standard normal distribution:
$$Z \gt 1.96 - \frac{2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}} \\ Z \lt -1.96 - \frac{2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}$$ where Z has a standard normal distribution.

So basically now all you have to do is plug the numbers into the right side and look at standard normal tables to see what the probability of these 2 situations is

Last edited: Feb 1, 2015
3. Feb 1, 2015

### FredericChopin

I see. And the power is calculated by adding the two probabilities?

Thank you so much for your comprehensive response.

4. Feb 1, 2015

### O_o

Yep you've got it. Think of the two critical regions as events. If the test statistic falls in the first region OR the second region we reject the null hypothesis. Since The two regions are disjoint, we add the probabilities using the usual probability rules (P(A or B) = P(A) + P(B) if A and B are disjoint).

5. Feb 2, 2015

### FredericChopin

Thank you so much!