## Hierarchical Modeling and Inference in Ecology: |

Chapter 1 | Conceptual and Philosophical Considerations in Ecology and Statistics | |
---|---|---|

Chapter 2 | Essentials of Statistical Inference | |

psi.MLE.R | MLE of psi (Panel 2.2) | |

mothMortality.Bayes.R | Logistic regression of moth mortalities: Bayesian model selection | |

fishSurvival.Bayes.R | Posterior distribution of larval fish survival (Panel 2.8) | |

muConfidenceInterval.R | Confidence interval for normal mean (Panel 2.7) | |

logitpsiConfidenceInterval.R | Confidence Interval for psi (Panel 2.6) | |

psiConfidenceInterval.R | Confidence Interval for psi (Panel 2.5) | |

normalObs.MLE.R | MLE for the normal distribution (Panel 2.3) | |

bruteForcePsi.MLE.R | MLE of psi by brute force (Panel 2.1) | |

Chapter 3 | Modeling Occupancy and Occurrence Probability | |

wtmatrix.csv | Willow tit data from the Swiss MHB program. These data are used in many of the analyses in Chs. 3 and 8. | |

utilfns.Rd | Basic logit utility functions | |

panel3pt1.fn.Rd | R function for executing code in panel 3.1 | |

panel3pt2.fn.Rd | Likelihood functions | |

panel3pt6.fn.Rd | R function for executing code in panel 3.6 | |

panel3pt8.fn.Rd | R wrapper for fitting occupancy model to the willow tit data using the likelihood specification given in Panel 3.8. This fits an occupancy model with covariates in both detection and occurrence probability using the zero-inflated binomial representation. Requires the willow tit data and utility functions | |

panel3pt8bayes.fn.R | R wrapper for fitting occupancy model with detection and abundance covariates to the willow tit data in WinBUGS. Requires the willow tit data and utility functions. | |

Chapter 4 | Occupancy and Abundance | |

RNmodelWinBUGS.R | simulates data under the model described in Royle and Nichols (2004) and fits that model in WinBUGS. | |

panel4pt5.fn | ABUNDANCE MIXTURE/Royle-Nichols Model w/overdispersion: R script for fitting RN model with over-dispersed abundance | |

panel4pt4.fn | R code for RN model with quasi-binomial detection (Panel 4.4) | |

catbird.y | Catbird detection frequency data for a BBS route (50 stops) based on J=11 surveys of the route | |

panel4pt1.fn | R code for fitting Royle-Nichols model (Panel 4.1) | |

panel4pt3.fn | R code for RN model with covariates, fitted to the willow tit data (Panel 4.3) | |

panel4pt2.fn | R code for fitting 2-state occupancy model, RN formulation (Panel 4.2) | |

Chapter 5 | Inference in Closed Populations | |

panel5pt6.fn | Data Augmentation/Behavioral Response - R script for fitting behavioral responses model to the Microtus data in WinBUGS by data augmentation. | |

panel5pt5.fn | Data Augmentation/Model M0 - R script for fitting Model M0 to the Microtus data in WinBUGS by data augmentation. | |

panel5pt4.fn | Closed Population/Double Observer - R function for fitting double observer model to waterfowl survey data (Panel 5.4) | |

panel5pt3.fn | Closed Population/Model Mt - R function for fitting Model Mt (Panel 5.3) | |

panel5pt2.fn | Closed Population/Model M0 - R function for fitting Model M0 to Microtus data (Panel 5.2) | |

microtus.data.R | Microtus data (thanks to J.D. Nichols) | |

Chapter 6 | Models with Individual Effects | |

malldata.R | Mallard Data used in panel6pt5.fn | |

panel6pt5.fn.R | DOUBLE OBSERVER MODEL W/INDIVIDUAL COVARIATE - DATA AUGMENTATION: Aerial waterfowl survey data collected using two observers. Model allows detection probability to vary as a function of group size. | |

panel6pt4.fn.R | CLOSED POPULATION MODEL - Behavioral response + Individual covariate - DATA AUGMENTATION IN WINBUGS. Microtus data, with behavioral response and body mass individual covariate (Panel 6.4). Requires R object 'microtus.data' (see Chapter 5 R files for data) | |

panel6pt3.fn.R | CLOSED POPULATION MODEL W/INDIVIDUAL COVARIATE - DATA AUGMENTATION IN WINBUGS. Microtus data, with body mass individual covariate (Panel 6.3, Table 6.4). Requires R object 'microtus.data' (see Chapter 5 R files for data) | |

panel6pt2.fn.R | CLOSED POPULATION MODEL W/HETEROGENEITY - DATA AUGMENTATION IN WINBUGS. Model Mh, logit-normal version, for Breeding Bird Survey Data (Panel 6.2) | |

panel6pt1.fn.R | CLOSED POPULATION MODEL W/HETEROGENEITY: Model Mh, logit-normal version, fitted to horned-lizard data (Panel 6.1) | |

bbsdata.R | SPECIES RICHNESS DATA: Breeding Bird Survey data from 1997-2001 (detection frequencies) analyzed in Section 6.3. See also Dorazio and Royle (2003). | |

Chapter 7 | Spatial Capture-Recapture Models | |

SCRmultinomial.fn.R | SPATIAL CAPTURE-RECAPTURE, R script for generating spatial capture recapture data under a multinomial observation model (Section 7.4), and then fitting the model to the simulated data using WinBUGS. The model is similar to that described in Chapter 7 but this is from Gardner et al. (2009; Ecology). More details are given in the header of the R script. | |

SCR.fn.R | SPATIAL CAPTURE-RECAPTURE - Binomial observation model: R script for simulating data and fitting a variation of the model described in Section 7.4. This model differs by the manner in which the probability of capture relates to individual activity center, and the observation model is binomial instead of multinomial. See comment in R script. This comes from Royle and Gardner(2008). | |

panel7pt1B.fn.R | DISTANCE SAMPLING, MLE from integrated likelihood under DATA AUGMENTATION (Section 7.1.6). Analysis of Impala data. | |

panel7pt1.fn.R | DISTANCE SAMPLING, BAYESIAN ANALYSIS in WINBUGS using DATA AUGMENTATION (Panel 7.1) | |

impala.R | DISTANCE SAMPLING: impala data (from K. Burnham). Used in Panel 7.1. To read into R type: source("impala.R") at command prompt. | |

Chapter 8 | Metapopulation Models of Abundance | |

table8pt2.fn | Binomial Mixture Model: R script for fitting the binomial/Poisson mixture model to the willow tit data. Produces output given in top half of Table 8.2. See Chapter 4 materials (panel4pt3.fn) for R script to prodce the bottom half of the table. | |

salamanderRemovals.Bayes.R | Bayesian analysis of salamander removal counts | |

salamanderRemovals2001.csv | Removal counts of salamanders | |

manateeCounts.Bayes.R | Bayesian analysis of manatee double-observer counts | |

manateeCounts.MLE.R | Frequentist analysis of manatee double-observer counts | |

manatees.txt | Double-observer counts of manatees | |

wtitCounts.Bayes2.R | Bayesian analysis of willow tit terrritory counts (overdispersed Poisson regression model of territories) | |

wtitCounts.Bayes.R | Bayesian analysis of willow tit territory counts (Poisson regression model of territories) | |

ovenCounts.Bayes.R | Bayesian analysis of ovenbird point counts | |

ovenCounts.MLE.R | Frequentist analysis of ovenbird point counts | |

oven.txt | Ovenbird point counts | |

Chapter 9 | Occupancy Dynamics | |

panel9pt4.fn.R | AUTOLOGISTIC MODEL IN WINBUGS -- R script to fit spatial occupancy model with p < 1 in WinBUGS (Panel 9.4). Uses the simulated data img.data | |

panel9pt2.fn.R | DYNAMIC OCCUPANCY MODEL -- R script to fit dynamic two-state occupancy model to the Crossbill data using WinBUGS. This model | |

panel9pt3.fn.R | AUTOLOGISTIC MODEL IN WINBUGS -- R script to fit spatial occupancy model (classical autologistic) in WinBUGS (Panel 9.3) . This version assumes p = 1. | |

panel9pt1.fn.R | DYNAMIC OCCUPANCY MODEL -- R script to fit dynamic two-state occupancy model to the Crossbill data using WinBUGS (Panel 9.1). This model assumes that p = 1. i.e., the occupancy state variable is observed perfectly. | |

img.data.R | AUTOLOGISTIC MODEL IN WINBUGS -- simulated data. This is an R list containing 4 elements which are used in panel9pt3.fn. Source this function into R using the command> source("img.data.R") | |

crossbill.data.R | Crossbill data from the Swiss Bird Survey. This is an R list. The first element "data" is 266 (sites) x 3 (reps) x 4 (years) | |

Chapter 10 | Modeling Population Dynamics | |

panel10pt2.fn.R | Jolly-Seber Model w/Individual Heterogeneity -- This R script fits the occupancy formulation of the Jolly-Seber model induced by data augmentation to the dipper data, and allows for individual heterogeneity in survival probability. This script produced the results in Table 10.3. The Markov chains mix slowly, so a long run is necessary to reduce Monte Carlo error. | |

table10pt2.fn.R | Jolly-Seber Model - Schwarz-Arnason parameterization by data augmentation. This model produced the results in Table 10.2. | |

panel10pt1B.fn.R | Jolly-Seber Model -- occupancy formulation induced by data augmentation -- using the alternative prior specification (see Section 10.3.7). Produces results consistent with those in Table 10.1 ("prior 2"). | |

panel10pt1.fn.R | Jolly-Seber Model -- occupancy formulation induced by data augmentation. R script for fitting model to the dipper data. Requires the file dipper.data -- load it into your R workspace using source("dipper.data.R"). Results are consistent with "prior 1" results in Table 10.1. There is a slight difference because M was set too low for the results reported in Table 10.1 | |

dipper.data.R | Dipper data used in Panel 10.1 | |

Chapter 11 | Modeling Survival | |

mapsdataspatial.list.R | DATA FILE: Monitoring Avian Productivity and Survivorship (MAPS) data for the spatial model described in Panel 11.6 | |

dipper.data.R | Dipper data used for fitting model in Panel 11.7. | |

panel11pt7.fn.R | R script containing WinBUGS specification of CJS model with individual heterogeneity in detection and survival probabilities. Model is fitted to the Dipper data. Results should be consistent with Table 11.6 in the text. The MCMC algorithm should be run for 100k iterations or more due to slow mixing. From Royle (2008; Biometrics 64:364-370). | |

panel11pt6.fn.R | Cormack-Jolly-Seber (CJS) model - SPATIAL VERSION: R script to fit CJS model to MAPS warbler data. This is a spatial version of the model in which the survival parameter is spatially indexed and the model contains a spatially correlated random effect. This requires the data file mapsdataspatial.list which is a very large file. Consult the WinBUGS manual for information about the data required to fit the CAR model. | |

mapsdata.list.R | DATA FILE: Monitoring Avian Productivity and Survivorship (MAPS) data used in Panel 11.5 | |

panel11pt5.fn.R | Cormack-Jolly-Seber (CJS) model with TRANSIENTS -- R script to fit CJS model with transients in WinBUGS. This is a simple model with year-specific detection and survival probabilities and a constant residency probability. Requires data file 'mapsdata.list' which can be sourced into your R workspace. | |

panel11pt4.fn.R | Cormack-Jolly-Seber (CJS) model -- R script to fit hierarchical formulation of the CJS model in WinBUGS. The small yellow warbler data set (Table 11.3) is contained within the R script. Results should coincide with Table 11.4. | |

panel11pt3.fn.R | Bayesian Nest survival analysis -- R script for fitting the nest survival model described in Panel 11.3 in WinBUGS. Requires nestdata.list. Results should coincide with Table 11.2. | |

nestdata.list.R | Nest survival data. American redstart data used in the analysis in Panel 11.2 -- a simple nest survival model. Data courtesy of Beth Hahn (U.S. Forest Service). | |

panel11pt2.fn.R | Nest survival analysis -- R script for optimizing the nest survival model likelihood shown in Panel 9.2 for the American redstart data. The model is a simple constant + AGE effect model. Requires nestdata.list | |

Chapter 12 | Models of Community Composition and Dynamics | |

detectionFreq.NH17.csv | Detections of species observed in the North American Breeding Bird Survey in 1991 (Route 017, New Hampshire) | |

MultiSpeciesOcc.R | Model of species occurrence in a community of unknown species richness | |

MultiSpeciesOcc.knownN.R | Model of species occurrence in a community of known species richness | |

Chapter 13 | Looking Back and Ahead |