# calculating mean and SE from two means and two SEs

A drug trial is conducted identically in two different groups that are essentially similar at baseline. Can I obtain a joint mean and a joint SE?

For example, Group A has placebo group of n=224 mean of 37.6 SE of 3.3 Group B has n=236 mean of 30.9 SE of 3.0 What is their combined mean and SE and how do you do it?

The mean will be the weighted average of the individual means. Call the combined group $X$ and let $N=N_A+N_B$. Essentially you need the sum of observations which can you write in terms of $\mu_A$ and $\mu_B$. $$\mu_X = \frac{1}{N}\sum_i x_i = \frac{1}{N_A+N_B}(N_A\mu_A+N_B\mu_B)$$ To compute the sample variance you do the exact same procedure, this time you need the sum of squared observations which you can write in terms of $s_A^2$ and $s_B^2$.
For $A$ (and similarly for $B$), $$\sum_i a_i^2 = (N_A-1)s_A^2+N_A\mu_A^2.$$ Then we are ready to compute: \begin{align*} s_X^2&=\frac{1}{N - 1}\left(\sum_i x_i^2 - N\mu_X^2\right)\\ &=\frac{1}{N - 1}\left((N_A - 1)s_A^2 + N_A\mu_A^2 + (N_B - 1)s_B^2 + N_B\mu_B^2 - N\mu_X^2\right) \end{align*}