Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

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 :

.xtreg y x1-x3, fe i(month) .areg y x1-x3, absorb(month) .regress y x1-x3 d1-d11

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.

This is document auur in domain all.
Last modified on April 27, 2011.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.