IDEAS home Printed from https://ideas.repec.org/p/arx/papers/2606.12739.html

Estimating Semiparametric and Nonparametric Fixed Effects Panel Data Models with mgcv

Author

Listed:
  • Ivan Korolev

Abstract

This paper provides a practical guide to estimating semiparametric and nonparametric fixed-effects panel data models using the mgcv package in R. The focus is implementation: handling fixed effects with unit indicators, first differencing, or penalized unit effects; specifying smooth terms; and conducting cluster-robust inference. Monte Carlo experiments compare \code{mgcv::bam} estimators with linear and fixed-series spline estimators. Simulations suggest that penalized splines adapt to unknown smoothness and estimate functions accurately in the designs studied here. A penalty-adjusted cluster-robust covariance estimator yields tests with near-nominal size for finite-dimensional parameters, and confidence bands provide accurate coverage for centered unknown functions.

Suggested Citation

  • Ivan Korolev, 2026. "Estimating Semiparametric and Nonparametric Fixed Effects Panel Data Models with mgcv," Papers 2606.12739, arXiv.org.
  • Handle: RePEc:arx:papers:2606.12739
    as

    Download full text from publisher

    File URL: https://arxiv.org/pdf/2606.12739
    File Function: Latest version
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Chen, Xiaohong & Pouzo, Demian, 2009. "Efficient estimation of semiparametric conditional moment models with possibly nonsmooth residuals," Journal of Econometrics, Elsevier, vol. 152(1), pages 46-60, September.
    2. James E. Pustejovsky & Elizabeth Tipton, 2018. "Small-Sample Methods for Cluster-Robust Variance Estimation and Hypothesis Testing in Fixed Effects Models," Journal of Business & Economic Statistics, Taylor & Francis Journals, vol. 36(4), pages 672-683, October.
    3. Chunrong Ai & Xiaohong Chen, 2003. "Efficient Estimation of Models with Conditional Moment Restrictions Containing Unknown Functions," Econometrica, Econometric Society, vol. 71(6), pages 1795-1843, November.
    4. A. Colin Cameron & Douglas L. Miller, 2015. "A Practitioner’s Guide to Cluster-Robust Inference," Journal of Human Resources, University of Wisconsin Press, vol. 50(2), pages 317-372.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Xiaohong Chen & Andres Santos, 2018. "Overidentification in Regular Models," Econometrica, Econometric Society, vol. 86(5), pages 1771-1817, September.
    2. Yanping Chen, 2026. "Robust Variance Estimation in Linear Regression: A Projection-Geometry Perspective," Papers 2609.01804, arXiv.org.
    3. Xiaohong Chen & Victor Chernozhukov & Sokbae Lee & Whitney K. Newey, 2014. "Local Identification of Nonparametric and Semiparametric Models," Econometrica, Econometric Society, vol. 82(2), pages 785-809, March.
    4. MacKinnon, James G. & Orregaard Nielsen, Morten & Webb, Matthew D., 2017. "Bootstrap and Asymptotic Inference with Multiway Clustering," Queen's Economics Department Working Papers 274712, Queen's University - Department of Economics.
    5. James G. MacKinnon & Morten Ørregaard Nielsen & Matthew D. Webb, 2023. "Fast and reliable jackknife and bootstrap methods for cluster‐robust inference," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 38(5), pages 671-694, August.
    6. Chen, Xiaohong & Pouzo, Demian, 2009. "Efficient estimation of semiparametric conditional moment models with possibly nonsmooth residuals," Journal of Econometrics, Elsevier, vol. 152(1), pages 46-60, September.
    7. Mammen, Enno & Rothe, Christoph & Schienle, Melanie, 2016. "Semiparametric Estimation With Generated Covariates," Econometric Theory, Cambridge University Press, vol. 32(5), pages 1140-1177, October.
    8. Karoline Strauss & Julija N. Mell & Frederik Anseel & Annemijn Loermans & David Sluss, 2026. "Complementarity in Future Selves: How Networks of Future-Oriented Cognitive Representations Influence Individuals’ Ability to Proactively and Adaptively Manage Their Career," Organization Science, INFORMS, vol. 37(1), pages 90-112, January.
    9. Andrews, Donald W.K., 2017. "Examples of L2-complete and boundedly-complete distributions," Journal of Econometrics, Elsevier, vol. 199(2), pages 213-220.
    10. Hong, Han & Mahajan, Aprajit & Nekipelov, Denis, 2015. "Extremum estimation and numerical derivatives," Journal of Econometrics, Elsevier, vol. 188(1), pages 250-263.
    11. Melanie Birke & Sebastien Van Bellegem & Ingrid Van Keilegom, 2017. "Semi-parametric Estimation in a Single-index Model with Endogenous Variables," Scandinavian Journal of Statistics, Danish Society for Theoretical Statistics;Finnish Statistical Society;Norwegian Statistical Association;Swedish Statistical Association, vol. 44(1), pages 168-191, March.
    12. Liu, Sining & Huang, Wendi, 2026. "Sustainable regulation, stronger currencies: Evidence from capital flow dynamics," Journal of International Money and Finance, Elsevier, vol. 162(C).
    13. Xiaohong Chen & Demian Pouzo, 2012. "Estimation of Nonparametric Conditional Moment Models With Possibly Nonsmooth Generalized Residuals," Econometrica, Econometric Society, vol. 80(1), pages 277-321, January.
    14. Juan Carlos Escanciano & Wei Li, 2013. "On the identification of structural linear functionals," CeMMAP working papers 48/13, Institute for Fiscal Studies.
    15. Nathan Kallus & Miruna Oprescu, 2022. "Robust and Agnostic Learning of Conditional Distributional Treatment Effects," Papers 2205.11486, arXiv.org, revised Jun 2025.
    16. Yu Zhu, 2020. "Inference in nonparametric/semiparametric moment equality models with shape restrictions," Quantitative Economics, Econometric Society, vol. 11(2), pages 609-636, May.
    17. Weilun Wu & Jianhua Duan & W. Robert Reed & Elizabeth Tipton, 2025. "What Can We Learn From 1000 Meta-Analyses Across 10 Different Disciplines?," Working Papers in Economics 25/07, University of Canterbury, Department of Economics and Finance.
    18. James G. MacKinnon, 2019. "How cluster-robust inference is changing applied econometrics," Canadian Journal of Economics, Canadian Economics Association, vol. 52(3), pages 851-881, August.
    19. repec:osf:metaar:3qp2w_v1 is not listed on IDEAS
    20. Xiaohong Chen & Demian Pouzo, 2015. "Sieve Wald and QLR Inferences on Semi/Nonparametric Conditional Moment Models," Econometrica, Econometric Society, vol. 83(3), pages 1013-1079, May.
    21. Ai, Chunrong & Chen, Xiaohong, 2012. "The semiparametric efficiency bound for models of sequential moment restrictions containing unknown functions," Journal of Econometrics, Elsevier, vol. 170(2), pages 442-457.

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:arx:papers:2606.12739. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: arXiv administrators (email available below). General contact details of provider: https://arxiv.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.