IDEAS home Printed from https://ideas.repec.org/a/jss/jstsof/v067i01.html
   My bibliography  Save this article

Fitting Linear Mixed-Effects Models Using lme4

Author

Listed:
  • Bates, Douglas
  • Mächler, Martin
  • Bolker, Ben
  • Walker, Steve

Abstract

Maximum likelihood or restricted maximum likelihood (REML) estimates of the parameters in linear mixed-effects models can be determined using the lmer function in the lme4 package for R. As for most model-fitting functions in R, the model is described in an lmer call by a formula, in this case including both fixed- and random-effects terms. The formula and data together determine a numerical representation of the model from which the profiled deviance or the profiled REML criterion can be evaluated as a function of some of the model parameters. The appropriate criterion is optimized, using one of the constrained optimization functions in R, to provide the parameter estimates. We describe the structure of the model, the steps in evaluating the profiled deviance or REML criterion, and the structure of classes or types that represents such a model. Sufficient detail is included to allow specialization of these structures by users who wish to write functions to fit specialized linear mixed models, such as models incorporating pedigrees or smoothing splines, that are not easily expressible in the formula language used by lmer.

Suggested Citation

  • Bates, Douglas & Mächler, Martin & Bolker, Ben & Walker, Steve, 2015. "Fitting Linear Mixed-Effects Models Using lme4," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 67(i01).
  • Handle: RePEc:jss:jstsof:v:067:i01
    DOI: http://hdl.handle.net/10.18637/jss.v067.i01
    as

    Download full text from publisher

    File URL: https://www.jstatsoft.org/index.php/jss/article/view/v067i01/v67i01.pdf
    Download Restriction: no

    File URL: https://www.jstatsoft.org/index.php/jss/article/downloadSuppFile/v067i01/lme4_1.1-10.tar.gz
    Download Restriction: no

    File URL: https://www.jstatsoft.org/index.php/jss/article/downloadSuppFile/v067i01/v67i01.R
    Download Restriction: no

    File URL: https://libkey.io/http://hdl.handle.net/10.18637/jss.v067.i01?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    References listed on IDEAS

    as
    1. Kyle Klein & Julian Neira, 2014. "Nelder-Mead Simplex Optimization Routine for Large-Scale Problems: A Distributed Memory Implementation," Computational Economics, Springer;Society for Computational Economics, vol. 43(4), pages 447-461, April.
    2. Loy, Adam & Hofmann, Heike, 2014. "HLMdiag: A Suite of Diagnostics for Hierarchical Linear Models in R," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 56(i05).
    3. Doran, Harold & Bates, Douglas & Bliese, Paul & Dowling, Maritza, 2007. "Estimating the Multilevel Rasch Model: With the lme4 Package," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 20(i02).
    4. Yeojin Chung & Sophia Rabe-Hesketh & Vincent Dorie & Andrew Gelman & Jingchen Liu, 2013. "A Nondegenerate Penalized Likelihood Estimator for Variance Parameters in Multilevel Models," Psychometrika, Springer;The Psychometric Society, vol. 78(4), pages 685-709, October.
    5. Nash, John C. & Varadhan, Ravi, 2011. "Unifying Optimization Algorithms to Aid Software System Users: optimx for R," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 43(i09).
    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. Hancock, Joana & Vieira, Sara & Lima, Hipólito & Schmitt, Vanessa & Pereira, Jaconias & Rebelo, Rui & Girondot, Marc, 2019. "Overcoming field monitoring restraints in estimating marine turtle internesting period by modelling individual nesting behaviour using capture-mark-recapture data," Ecological Modelling, Elsevier, vol. 402(C), pages 76-84.
    2. Jack McDonnell & Thomas McKenna & Kathryn A. Yurkonis & Deirdre Hennessy & Rafael Andrade Moral & Caroline Brophy, 2023. "A Mixed Model for Assessing the Effect of Numerous Plant Species Interactions on Grassland Biodiversity and Ecosystem Function Relationships," Journal of Agricultural, Biological and Environmental Statistics, Springer;The International Biometric Society;American Statistical Association, vol. 28(1), pages 1-19, March.
    3. Arzum Akkaş & Nachiketa Sahoo, 2020. "Reducing Product Expiration by Aligning Salesforce Incentives: A Data‐driven Approach," Production and Operations Management, Production and Operations Management Society, vol. 29(8), pages 1992-2009, August.
    4. Zong, Weiyan & Zhang, Junyi & Yang, Xiaoguang, 2023. "Building a life-course intertemporal discrete choice model to analyze migration biographies," Journal of choice modelling, Elsevier, vol. 47(C).
    5. Fatima-Zahra Jaouimaa & Daniel Dempsey & Suzanne Van Osch & Stephen Kinsella & Kevin Burke & Jason Wyse & James Sweeney, 2021. "An age-structured SEIR model for COVID-19 incidence in Dublin, Ireland with framework for evaluating health intervention cost," PLOS ONE, Public Library of Science, vol. 16(12), pages 1-25, December.
    6. Barakat, Bilal Fouad & Dharamshi, Ameer & Alkema, Leontine & Antoninis, Manos, 2021. "Adjusted Bayesian Completion Rates (ABC) Estimation," SocArXiv at368, Center for Open Science.
    7. Li, Kai & Chen, Pei-Ying & Yan, Erjia, 2019. "Challenges of measuring software impact through citations: An examination of the lme4 R package," Journal of Informetrics, Elsevier, vol. 13(1), pages 449-461.
    8. repec:jss:jstsof:20:i01 is not listed on IDEAS
    9. repec:jss:jstsof:39:i12 is not listed on IDEAS
    10. Bivand, Roger & Piras, Gianfranco, 2015. "Comparing Implementations of Estimation Methods for Spatial Econometrics," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 63(i18).
    11. Fritsch, Markus & Pua, Andrew Adrian Yu & Schnurbus, Joachim, 2019. "Pdynmc - An R-package for estimating linear dynamic panel data models based on linear and nonlinear moment conditions," Passauer Diskussionspapiere, Betriebswirtschaftliche Reihe B-39-19, University of Passau, Faculty of Business and Economics.
    12. repec:rri:wpaper:201301 is not listed on IDEAS
    13. Gong Chen & Hartmut Fricke & Ostap Okhrin & Judith Rosenow, 2022. "Importance of Weather Conditions in a Flight Corridor," Stats, MDPI, vol. 5(1), pages 1-27, March.
    14. Minjeong Jeon & Sophia Rabe-Hesketh, 2012. "Profile-Likelihood Approach for Estimating Generalized Linear Mixed Models With Factor Structures," Journal of Educational and Behavioral Statistics, , vol. 37(4), pages 518-542, August.
    15. Christopher N. Boyer & Dayton M. Lambert & Charles C. Martinez & Joshua G. Maples, 2023. "Beef and pork processing plant labor costs," Agribusiness, John Wiley & Sons, Ltd., vol. 39(3), pages 691-702, July.
    16. de Leeuw, Jan & Mair, Patrick, 2007. "An Introduction to the Special Volume on "Psychometrics in R"," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 20(i01).
    17. Sameh Abdulah & Yuxiao Li & Jian Cao & Hatem Ltaief & David E. Keyes & Marc G. Genton & Ying Sun, 2023. "Large‐scale environmental data science with ExaGeoStatR," Environmetrics, John Wiley & Sons, Ltd., vol. 34(1), February.
    18. Stavrakoudis, Athanassios & Panagiotou, Dimitrios, 2016. "Price dependence and asymmetric responses between coffee varieties," Agricultural Economics Review, Greek Association of Agricultural Economists, vol. 17(2), June.
    19. repec:jss:jstsof:36:c01 is not listed on IDEAS
    20. Alexander Robitzsch, 2021. "A Comprehensive Simulation Study of Estimation Methods for the Rasch Model," Stats, MDPI, vol. 4(4), pages 1-23, October.
    21. Sarrias, Mauricio, 2016. "Discrete Choice Models with Random Parameters in R: The Rchoice Package," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 74(i10).
    22. Michal Engelman & Christopher L. Seplaki & Ravi Varadhan, 2017. "A Quiescent Phase in Human Mortality? Exploring the Ages of Least Vulnerability," Demography, Springer;Population Association of America (PAA), vol. 54(3), pages 1097-1118, June.
    23. Baty, Florent & Ritz, Christian & Charles, Sandrine & Brutsche, Martin & Flandrois, Jean-Pierre & Delignette-Muller, Marie-Laure, 2015. "A Toolbox for Nonlinear Regression in R: The Package nlstools," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 66(i05).
    24. Meager, Rachael, 2019. "Understanding the average impact of microcredit expansions: a Bayesian hierarchical analysis of seven randomized experiments," LSE Research Online Documents on Economics 88190, London School of Economics and Political Science, LSE Library.

    More about this item

    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:jss:jstsof:v:067:i01. 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: Christopher F. Baum (email available below). General contact details of provider: http://www.jstatsoft.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.