In Stata, why does .xtreg return an R-squared statistic for fixed-effects models that is different from that reported in SAS and LIMDEP?
The Stata .xtreg command fits various panel
data models, including fixed- and random-effects models. For the
fixed-effects model, .xtreg estimates within-group
variation by computing the differences between observed values and
their means. This model produces correct parameter estimates without
creating dummy variables; however, due to the larger degrees of
freedom, its standard errors and, consequently, R-squared statistic
are incorrect. That is, the R-squared statistic labeled R-sq:
within = is not correct.
To get a correct estimate of the R-squared statistic, you have two
options. You may use the Stata .areg or
.regress commands to get the estimate; alternatively, you
may fit the model using SAS (PROC PANEL) or LIMDEP
(Regress), which report adjusted standard errors and
R-squared.
For example, if you regress y on three independent
variables, x1 through x3 , and are
interested in the fixed effects for the group variable
month , you can estimate the fixed-effects model
using .xtreg , .areg and
.regress :
d1 through d11 are dummy variables for the
months January through November. Keep in mind that
.regress requires that you create dummy variables in
advance. Both .regress and .areg produce
correct parameter estimates, standard errors, and R-squared
statistics. The .areg command is useful, particularly
when the group variable has many categories.
For more about statistical and mathematical software, email the UITS Stat/Math Center, visit the center's web page, or phone 812-855-4724 (IUB) or 317-278-4740 (IUPUI). The center is located in Bloomington at 410 N. Park Avenue, and is open for consultation by appointment Monday-Friday 9am-5pm.
Last modified on April 27, 2011.







