How should I fit heteroskedasticity by group? I am trying to fit panel data to a model of the form
$$y_{t,i} = \sum_{j} X_{t,i,j} \beta_j + \sum_k Z_{t,i,k} \gamma_{i,k} + \sigma_i \epsilon_{t,i},$$
where the regressors $X$ and $Z$ are observed along with the regressand $y$, and the $\epsilon_{t,i}$ are assumed i.i.d. (The coefficients $\gamma$ are like 'fixed effects' and one of the $Z$s is identically 1.) I can fit the model assuming homoskedasticity across the groups (i.e. assuming the $\sigma_i$ are identical), but am not sure how to proceed if I also want to fit the $\sigma_i$. How might I do this? Would this be appropriate for FGLS? Is there a known name for this problem? 
 A: You could fit the model completely ignoring the heteroskedasticity. Under the other Gauss-Markov assumptions (linearity, exogeneity, no multicolinearity, no serial correlation), you get unbiased estimators for the coefficients. These estimators are not efficient, however. Additionally, the estimators for the standard errors are incorrect. Weighting a la FGLS would be a way to achieve efficiency and correct standard errors.
Alternatively, you could accept the inefficiency, but find correct standard errors for regular OLS. Most commonly, we would use robust standard errors, which allow the $\sigma$ to vary by observation, rather than by group. It seems to me that you could build off of this idea, replacing the individual-specific estimates of the variance with some kind of average of these estimates within a group that would be the same for all group members. I don't think that I've seen this, though.
A further complication that you didn't mention, but looks like you need to consider, is correlation for a unit across time (subscript $t$?). This introduces another issues for correcting the standard errors that you can't solve just by tweaking your estimate of $\sigma$. You should check out the paper by Bertrand, Duflo, and Mullainathan: "How Much Should we Trust Difference-in-Difference Estimators?" [pre-pub] While you aren't doing diff-in-diff, the issues are the same. They suggest bootstrapping the standard errors and using regular OLS.
A: Robust standard errors in stata would correct for arbitrary form of heteroskedasticity to ensure efficiency.
In a panel, you may also want to correct for serial correlation and clustering within group. 
