Law of total variance
Where:
is a vector of observations, e.g. trait values is a vector of indicators telling which group each individual measurement comes from. - Like how we used X = 0 or 1 in last week's example comparing two populations with linear regression
- This only holds if the residual variance is independent from the variance in covariates - if there is correlation there are some problems, but we won't worry about this for now
Proof: Wikipedia