Generalized linear mixed models provide a flexible framework for modeling a range of data, although with non-Gaussian response variables the likelihood cannot be obtained in closed form. Markov chain Monte Carlo methods solve this problem by sampling from a series of simpler conditional distributions that can be evaluated. The R package MCMCglmm, implements such an algorithm for a range of model fitting problems. More than one response variable can be analysed simultaneously, and these variables are allowed to follow Gaussian, Poisson, multi(bi)nominal, exponential, zero-inflated and censored distributions. A range of variance structures are permitted for the random effects, including interactions with categorical or continuous variables (i.e., random regression), and more complicated variance structures that arise through shared ancestry, either through a pedigree or through a phylogeny. Missing values are permitted in the response variable(s) and data can be known up to some level of measurement error as in meta-analysis. All simulation is done in C/ C++ using the CSparse library for sparse linear systems. If you use the software please cite this article, as published in the Journal of Statistic Software (Hadfield 2010) Keywords: MCMC, linear mixed model, pedigree, phylogeny, animal model, multivariate, sparse, R.Due to their flexibility, linear mixed models are now widely used across the sciences (Brown and Prescott 1999;Pinheiro and Bates 2000;Demidenko 2004). However, generalizing these models to non-Gaussian data has proved difficult because integrating over the random effects is intractable (McCulloch and Searle 2001). Although techniques that approximate these integrals (Breslow and Clayton 1993) are now popular, Markov chain Monte Carlo (MCMC) methods provide an alternative strategy for marginalizing the random effects that may be more robust (Zhao, Staudenmayer, Coull, and Wand 2006;Browne and Draper 2006). Developing MCMC methods for generalized linear mixed models (GLMM) is an active area of research (e.g., Zeger and Karim 1991;Damien, Wakefield, and Walker 1999;Sorensen and Gianola 2002;Zhao et al. 2006), and several software packages are now available that implement these techniques (e.g., WinBUGS (Spiegelhalter, Thomas, Best, and Lunn 2003), MLwiN (Rasbash, Steele, Browne, and Prosser 2005), glmmBUGS (Brown 2009), JAGS (Plummer 2003)). However, these methods often require a certain level of expertise on behalf of the user and may take a great deal of computing time. The MCMCglmm package for R (R Development Core Team 2009) implements Markov chain Monte Carlo routines for fitting multi-response generalized linear mixed models. A range of distributions are supported and several types of variance structure for the random effects and the residuals can be fitted. The aim is to provide routines that require little expertise on behalf of the user while reducing the 2 MCMCglmm amount of computing time required to adequately sample the posterior distribution.In this paper we explain the underlying ...