Skip to content

nationalparkservice/bayes-for-non-ignorable-designs

Repository files navigation

Analysis CI Docker

bayes-for-non-ignorable-designs

Code and data for the analyses described in the paper:

Zachmann, L.J., Borgman, E.M., Witwicki, D.L. et al. Bayesian Models for Analysis of Inventory and Monitoring Data with Non-ignorable Missingness. JABES (2021). https://doi.org/10.1007/s13253-021-00473-z

Getting started

First, clone the repo, cd into the project directory, then use the shell script get-inputs.sh to obtain the various "protected" data assets used in the example analyses. The data live on the NPS Data Store. get-inputs.sh uses wget to download the zip file, unpack its contents, and move data files and directories to their appropriate location in the file tree.

git clone https://github.com/nationalparkservice/bayes-for-non-ignorable-designs.git
cd bayes-for-non-ignorable-designs
./get-inputs.sh

A special note for Windows users

Windows users will likely need Git Bash to run the commands above. Git Bash does not come with wget preinstalled. To intall wget, follow these directions.

Requirements

R and JAGS. Specifically, we make use of the following R packages: abind, rjags, coda, HDInterval, spsurvey, tidyverse, hrbrthemes, ggridges, and cowplot.

If you'd like to use Docker to avoid issues with dependencies, you can build and launch an RStudio Server instance using:

./docker/run.sh

The above command assumes you have already cloned the repo and have cd'ed into the project directory. Once the container is running, simply open your browser to http://localhost:8787/ using "bayes" as username and password.

Figures from the manuscript

Basic context

Study area, missingness in space and time.

Study area Spatial Temporal
study area spat miss time miss

Examples

  1. Changes in observers and missing covariates
Figure 3 Figure 4
ex1 fig1 ex1 fig2
  1. Unequal probabilities of inclusion
Figure 5a Figure 5b Figure 5c
ex2 fig-a ex2 fig-b ex2 fig-c
  1. Censored and truncated data
Figure 6a Figure 6b
ex3 fig-a ex3 fig-b

Disclaimers

  1. The JAGS models utilize a notation that differs subtly from the model math as it appears in the manuscript. For instance, the intercept and trend slope coefficients – the $\boldsymbol{\alpha}_k$ terms in the manuscript – appear as B[j, 1, k] and B[j, 2, k], respectively. Likewise, we use x and X in place of $t$ and $\textbf{W}$.
  2. Though we discuss variography in the manuscript, we do not include information on the spatial location of individual sites here in order to protect the confidentiality of the data.
  3. For purposes of clarity, and to meet page constraints, we omitted some details about the censored and truncated canopy gap size data. Specifics are included in a README for the censored and truncated data example.
  4. The RNG and other hidden state in your programming environment might cause results to differ subtly from those appearing in the manuscript -- the qualitative inference and conclusions drawn should not.

Contributors

Authors: Luke Zachmann*, Tom Hobbs, Erin Borgman, Dana Witwicki, Megan Swan, Cheryl McIntyre, and Carolyn Livensperger

* maintainer (lzachmann@gmail.com)

Developer notes

The assets directory is tracked using Git LFS, which we set up using git lfs track "assets/**" (quotes required to avoid shell expansion).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published