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. 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. 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.
    2. 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.
    3. 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.
    4. 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.
    5. 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.
    6. repec:osf:metaar:3qp2w_v1 is not listed on IDEAS
    7. Weiss, Amanda, 2024. "How Much Should We Trust Modern Difference-in-Differences Estimates?," OSF Preprints bqmws, Center for Open Science.
    8. David Blazar & Blake Heller & Thomas J. Kane & Morgan Polikoff & Douglas O. Staiger & Scott Carrell & Dan Goldhaber & Douglas N. Harris & Rachel Hitch & Kristian L. Holden & Michal Kurlaender, 2020. "Curriculum Reform in The Common Core Era: Evaluating Elementary Math Textbooks Across Six U.S. States," Journal of Policy Analysis and Management, John Wiley & Sons, Ltd., vol. 39(4), pages 966-1019, September.
    9. Francis L. Huang, 2022. "Analyzing Cross-Sectionally Clustered Data Using Generalized Estimating Equations," Journal of Educational and Behavioral Statistics, , vol. 47(1), pages 101-125, February.
    10. James G. MacKinnon & Morten Ørregaard Nielsen & Matthew D. Webb, 2023. "Leverage, influence, and the jackknife in clustered regression models: Reliable inference using summclust," Stata Journal, StataCorp LLC, vol. 23(4), pages 942-982, December.
    11. Djogbenou, Antoine & MacKinnon, James G. & Orregaard Nielsen, Morten, 2017. "Validity of Wild Bootstrap Inference with Clustered Errors," Queen's Economics Department Working Papers 274709, Queen's University - Department of Economics.
    12. James G. MacKinnon & Morten Ørregaard Nielsen & Matthew D. Webb, 2021. "Wild Bootstrap and Asymptotic Inference With Multiway Clustering," Journal of Business & Economic Statistics, Taylor & Francis Journals, vol. 39(2), pages 505-519, March.
    13. MacKinnon, James G. & Nielsen, Morten Ørregaard & Webb, Matthew D., 2023. "Cluster-robust inference: A guide to empirical practice," Journal of Econometrics, Elsevier, vol. 232(2), pages 272-299.
    14. MacKinnon, James G. & Webb, Matthew D., 2017. "Pitfalls when Estimating Treatment Effects Using Clustered Data," Queen's Economics Department Working Papers 274713, Queen's University - Department of Economics.
    15. repec:osf:osfxxx:bqmws_v1 is not listed on IDEAS
    16. repec:osf:metaar:3qp2w_v2 is not listed on IDEAS
    17. Djogbenou, Antoine A. & MacKinnon, James G. & Nielsen, Morten Ørregaard, 2019. "Asymptotic theory and wild bootstrap inference with clustered errors," Journal of Econometrics, Elsevier, vol. 212(2), pages 393-412.
    18. Jeffrey D. Michler & Anna Josephson, 2022. "Recent developments in inference: practicalities for applied economics," Chapters, in: A Modern Guide to Food Economics, chapter 11, pages 235-268, Edward Elgar Publishing.
    19. Miao Wang & Hong Zhuang, 2022. "Effect of official development assistance on adolescent fertility rate: within-country evidence," Economics Bulletin, AccessEcon, vol. 42(2), pages 566-590.
    20. Schwartz, Joseph A. & Allen, Samantha L., 2024. "The accumulated impact of direct and indirect workplace violence exposure on mental health and physiological activity among correctional officers," Journal of Criminal Justice, Elsevier, vol. 93(C).
    21. Jongmoo Jay Choi & Hoje Jo & Jimi Kim & Moo Sung Kim, 2018. "Business Groups and Corporate Social Responsibility," Journal of Business Ethics, Springer, vol. 153(4), pages 931-954, December.
    22. Francesca Carta & Lucia Rizzica, 2015. "Female employment and pre-kindergarten: on the uninteded effects of an Italian reform," Temi di discussione (Economic working papers) 1030, Bank of Italy, Economic Research and International Relations Area.
    23. Rotunno, Lorenzo, 2016. "Political stability and trade agreements: Evidence for ‘endgame FTAs’," European Journal of Political Economy, Elsevier, vol. 45(C), pages 133-148.

    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.