We study the effect on wages of time-varying variables, such as age or tenure. At the same time, we are interested in the effects of time-invariant variables, such as race. An FE model will omit any variable that remains constant across time and thus cannot fully answer our research question. An RE model may yield inconsistent estimates because of the possible correlation between individual time-invariant heterogeneity and the regressors age and tenure.
We can use a CRE model to circumvent both problems. Let’s see it in action.

© Copyright 1996–2026 StataCorp LLC. All rights reserved.
xtreg, cre reports coefficients for the variables in the model (xit_vars) and for their respective panel means (xt_means). In CRE models, panel means are added to the regression to control for potential endogeneity and to correct bias. This procedure gives us the same coefficients we obtain from the corresponding FE model for the time-varying regressors:

We get the benefits of an FE model but do not lose information about time-invariant features of our model.
xtreg, cre performs a Mundlak specification test to help you choose between an RE and FE or CRE model. Unlike a Hausman test, this test is fully robust and remains valid even when a robust vce(), such as vce(cluster idcode), is specified. From the earlier output of xtreg, cre, the Mundlak test, reported beneath the coefficient table, provides strong evidence in favor of the CRE model.