R code that takes in the nest capture history data (chdata.csv), reformats it for model fitting in the Bayesian MCMC software JAGS via the R package jagsUI. Various generalized linear mixed models are fit using a Huggins two occasion capture history model structure as in Program Mark. A series of models of increasing complexity are fit and compared using DIC. Model text is written to text files for each model but is generally not used or saved. Posteriors are saved as Rworkspaces or written to text files for use in population estimation (nostpop.R). Code can be run to generate model results and R workspaces/objects to inspect parameter estimates. The primary purpose of this code is to compare various mixed model structures for predicting detection rates and using the posterior in nest population estimation. Some non-mixed effect model are also fit that were fit using Mark for comparison. The most important result here is that the model with random effects for plot, crew, and year as well as other covariates is the best model for predicting nest detection. This is similar to fixed effect (Mark) models where plot and year were important fixed effects on detection.