Population contains two independent parts: Group A & Group B with size $N_A$ nad $N_B$.
$N = N_A + N_B$
Now sample from Group A and Group B separately. Sample size $n_A$, $n_B$.
$n = n_A + n_B$
To Estimate Group A mean and Group B mean, it's simply the sample mean in sample A and sample B. But to estimate the population (A&B) mean: I come up with two ways:
- combine sample A and sample B together, calculates its mean $x$, which is $(x_A n_A + x_B n_B)/(n_A + n_B)$
- calculates sample mean respectively, $x_A, x_B$, then estimate for population mean is $(x_A N_A + x_B N_B)/(N_A + N_B)$
Obvious, one of them has to be wrong (maybe both?). But I don't know why. I also have the problem when it comes to estimation of population variance.