# How do I test whether means are equal when I have summary stats for 2 samples from one population and for 1 sample from a second? [duplicate]

I think this is a "meta-analysis" situation.

I've got 3 samples (from 3 studies); I've assumed that two are from population A (treatment A) and one is from population B (treatment B). I have the sample means, standard errors & sample sizes for each sample (and that's all). I want to test if the pop A mean equals the pop B mean.

I did t-tests for samples A1 vs B1 and A2 vs B1 and got p-values of like 0.6 and 0.3 respectively. What can I say about A vs B overall? How do I get an overall p-value for the null hypothesis $\mu_A = \mu_B$?

I can compute the sample mean of A1 union A2, by taking the weighted average of the two means. It would be nice if I just had the sample variance of A1 union A2, but I don't (I'd guess it's about equal to the sum of the A1 variance and A2 variance..).

[sorry I'm sure there's a bunch of answers to this on here and elsewhere, but I'm unable to identify/understand them]

• Formulas for the sample variance of $A_1 \cup A_2$ are given at stats.stackexchange.com/questions/43159. Does that solve your problem?
– whuber
Jun 22 '16 at 21:48
• Oh wow yes, you can just calculate the sample variance huh, thank you!
– xmq
Jun 22 '16 at 21:56
• Note that the linked thread seems to have the n-denominator version of variance. You'll presumably want the n-1 denominator version (which can be computed from it of course). If you can't see your way to it, the usual n-1-denominator version of combined variance is here (scroll down to the unequal-sample-size version which is lower down in the answer). You also need the combined mean (which is immediately under the variance formula). Jun 22 '16 at 22:57
• yes thank you! nice to have the full formula. i just plugged in $\sigma^2 = \frac{n-1}{n}s^2$ into the formula given in the duplicate question. So with mean/(n-1)-variance/sample sizes of $\mu_1, s_1^2, n_1$ and $\mu_2, s_2^2, n_2$, we can find the union variance $s_{12}^2$ from $$(n_1 + n_2 -1)s_{12}^2 + (n_1+n_2)\mu_{12}^2 = (n_1-1) s_1^2 + n_1 \mu_1^2 + (n_2-1) s_2^2 + n_2\mu_2^2$$, where the union mean is just sample-size-weighted average: $\mu_{12} = \frac{n_1\mu_1 + n_2\mu_2}{n_1+n_2}$.
– xmq
Jun 23 '16 at 9:41