Bayesian Data Analysis in Ecology Using Linear Models with R, BUGS, and Stan
Copyright
Digital Assets
Acknowledgments
1. Why do we Need Statistical Models and What is this Book About?
1.1 Why We Need Statistical Models
1.2 What This Book is About
Further Reading
2. Prerequisites and Vocabulary
2.1 Software
2.1.1 What Is R?
2.1.2 Working with R
2.2 Important Statistical Terms and How to Handle Them in R
2.2.1 Data Sets, Variables, and Observations
2.2.2 Distributions and Summary Statistics
2.2.3 More on R Objects
2.2.4 R Functions for Graphics
2.2.5 Writing Our Own R Functions
Further Reading
3. The Bayesian and the Frequentist Ways of Analyzing Data
3.1 Short Historical Overview
3.2 The Bayesian Way
3.2.1 Estimating the Mean of a Normal Distribution with a Known Variance
3.2.2 Estimating Mean and Variance of a Normal Distribution Using Simulation
3.3 The Frequentist Way
3.4 Comparison of the Bayesian and the Frequentist Ways
Further Reading
4. Normal Linear Models
4.1 Linear Regression
4.1.1 Background
4.1.2 Fitting a Linear Regression in R
4.1.3 Drawing Conclusions
4.1.4 Frequentist Results
4.2 Regression Variants: ANOVA, ANCOVA, and Multiple Regression
4.2.1 One-Way ANOVA
4.2.2 Frequentist Results from a One-Way ANOVA
4.2.3 Two-Way ANOVA
4.2.4 Frequentist Results from a Two-Way ANOVA
4.2.5 Multiple Comparisons and Post Hoc Tests
4.2.6 Analysis of Covariance
4.2.7 Multiple Regression and Collinearity
4.2.8 Ordered Factors and Contrasts
4.2.9 Quadratic and Higher Polynomial Terms
Further Reading
5. Likelihood
5.1 Theory
5.2 The Maximum Likelihood Method
5.3 The Log Pointwise Predictive Density
Further Reading
6. Assessing Model Assumptions: Residual Analysis
6.1 Model Assumptions
6.2 Independent and Identically Distributed
6.3 The QQ Plot
6.4 Temporal Autocorrelation
6.5 Spatial Autocorrelation
6.6 Heteroscedasticity
Further Reading
7. Linear Mixed Effects Models
7.1 Background
7.1.1 Why Mixed Effects Models?
7.1.2 Random Factors and Partial Pooling
7.2 Fitting a Linear Mixed Model in R
7.3 Restricted Maximum Likelihood Estimation
7.4 Assessing Model Assumptions
7.5 Drawing Conclusions
7.6 Frequentist Results
7.7 Random Intercept and Random Slope
7.8 Nested and Crossed Random Effects
7.9 Model Selection in Mixed Models
Further Reading
8. Generalized Linear Models
8.1 Background
8.2 Binomial Model
8.2.1 Background
8.2.2 Fitting a Binomial Model in R
8.2.3 Assessing Model Assumptions: Overdispersion and Zero-Inflation
Option 1
Option 2
8.2.4 Drawing Conclusions
8.2.5 Frequentist Results
8.3 Fitting a Binary Logistic Regression in R
8.3.1 Some Final Remarks
8.4 Poisson Model
8.4.1 Background
8.4.2 Fitting a Poisson-Model in R
8.4.3 Assessing Model Assumptions
8.4.4 Drawing Conclusions
8.4.5 Modeling Rates and Densities: Poisson Model with an Offset
8.4.6 Frequentist Results
Further Reading
9. Generalized Linear Mixed Models
9.1 Binomial Mixed Model
9.1.1 Background
9.1.2 Fitting a Binomial Mixed Model in R
9.1.3 Assessing Model Assumptions
9.1.4 Drawing Conclusions
9.2 Poisson Mixed Model
9.2.1 Background
9.2.2 Fitting a Poisson Mixed Model in R
9.2.3 Assessing Model Assumptions
9.2.4 Drawing Conclusions
9.2.5 Modeling Bird Densities by a Poisson Mixed Model Including an Offset
Further Reading
10. Posterior Predictive Model Checking and Proportion of Explained Variance
10.1 Posterior Predictive Model Checking
10.2 Measures of Explained Variance
Further Reading
11. Model Selection and Multimodel Inference
11.1 When and Why We Select Models and Why This is Difficult
11.2 Methods for Model Selection and Model Comparisons
11.2.1 Cross-Validation
11.2.2 Information Criteria: Akaike Information Criterion and Widely Applicable Information Criterion
11.2.3 Other Information Criteria
11.2.4 Bayes Factors and Posterior Model Probabilities
11.2.5 Model-Based Methods to Obtain Posterior Model Probabilities and Inclusion Probabilities
11.2.6 “Least Absolute Shrinkage and Selection Operator” 䰀䄀匀匀伀 and Ridge Regression
11.3 Multimodel Inference
11.4 Which Method to Choose and Which Strategy to Follow
Further Reading
12. Markov Chain Monte Carlo Simulation
12.1 Background
12.2 MCMC Using BUGS
12.2.1 Using BUGS from OpenBUGS
12.2.2 Using BUGS from R
12.3 MCMC Using Stan
12.4 Sim, BUGS, and Stan
Further Reading
13. Modeling Spatial Data Using GLMM
13.1 Background
13.2 Modeling Assumptions
13.3 Explicit Modeling of Spatial Autocorrelation
13.3.1 Starting the Model Fitting
13.3.2 Variogram Modeling
13.3.3 Bayesian Modeling
13.3.4 OpenBUGS Example
Further Reading
14. Advanced Ecological Models
14.1 Hierarchical Multinomial Model to Analyze Habitat Selection Using BUGS
14.2 Zero-Inflated Poisson Mixed Model for Analyzing Breeding Success Using Stan
14.3 Occupancy Model to Measure Species Distribution Using Stan
14.4 Territory Occupancy Model to Estimate Survival Using BUGS
14.5 Analyzing Survival Based on Mark-Recapture Data Using Stan
Further Reading
15. Prior Influence and Parameter Estimability
15.1 How to Specify Prior Distributions
15.2 Prior Sensitivity Analysis
15.3 Parameter Estimability
Further Reading
16. Checklist
16.1 Data Analysis Step by Step
Step 1: Plausibility of Data
Step 2: Relationships
Step 3: Error Distribution
Step 4: Preparation of Explanatory Variables
Step 5: Data Structure
Step 6: Fit the Model
Step 7: Check Model Assumptions, Fit, and Sensitivity
Step 8: Model Uncertainty
Step 9: Draw Conclusions
Further Reading
17. What Should I Report in a Paper
17.1 How to Present the Results
17.2 How to Write Up the Statistical Methods
Further Reading
References
Index