xtnumfac: A battery of estimators for the number of common factors in time series and panel-data models

Jan Ditzen, Simon Reese

Research output: Contribution to journalArticlepeer-review


In this article, we introduce a new community-contributed command, xtnumfac, for estimating the number of common factors in time-series and panel datasets using the methods of Bai and Ng (2002, Econometrica 70: 191–221), Ahn and Horenstein (2013, Econometrica 81: 1203–1227), Onatski (2010, Review of Economics and Statistics 92: 1004–1016), and Gagliardini, Ossola, and Scaillet (2019, Journal of Econometrics 212: 503–521). Common factors are usually unobserved or unobservable. In time series, they influence all predictors, while in paneldata models, they influence all cross-sectional units at different degrees. Examples are shocks from oil prices, inflation, or demand or supply shocks. Knowledge about the number of factors is key for multiple econometric estimation methods, such as Pesaran (2006, Econometrica 74: 967–1012), Bai (2009, Econometrica 77: 1229–1279), Norkute et al. (2021, Journal of Econometrics 220: 416–446), and Kripfganz and Sarafidis (2021, Stata Journal 21: 659–686). This article discusses a total of 10 methods to estimate the number of common factors. Examples based on Kapetanios, Pesaran, and Reese (2021, Journal of Econometrics 221: 510–541) show that U.S. house prices are exposed to up to 10 common factors. Therefore, when one fits models with house prices as a dependent variable, the number of factors must be considered.

Original languageEnglish
Pages (from-to)438-454
Number of pages17
JournalStata Journal
Issue number2
Publication statusPublished - 2023 Jun

Subject classification (UKÄ)

  • Economics

Free keywords

  • common factors
  • cross-section dependence
  • factor models
  • panel-data models
  • st0715
  • time-series models
  • xtnumfac


Dive into the research topics of 'xtnumfac: A battery of estimators for the number of common factors in time series and panel-data models'. Together they form a unique fingerprint.

Cite this