Supplementary material and reproducible research files for article “A joint Bayesian framework for missing data and measurement error using integrated nested Laplace approximations

Preprint: arxiv.org/abs/2303.15240

Authors: Skarstein, E., Martino, S., Muff, S.

This supplementary material was written by Skarstein, E., but code for analysis was developed jointly between authors.

In case of any questions or comments, please do not hesitate to contact !

This website contains scripts, tutorials and data to reproduce all analysis and figures from the manuscript.

Examples

These include scripts to run the code for analysis, including comments and explanations.

For a step-by-step introduction with detailed explanations, see Simulation example. This is a single sun of the simulation study shown in the paper, and the full code for the study can be found in Simulation study. The data and model used in these examples reflect the most general case where we have a covariate with classical and Berkson measurement error, as well as missing data. For many users inlabru might be more intuitive than plain INLA, and so we have also included the same model implemented in inlabru in Example in inlabru.

The remaining examples are variations on the above model using different data sets, see the table below for an overview of the different types of ME in the different examples.

Example Classical ME Berkson ME Missing data
Missing covariate imputation x
Missing and mismeasured covariate x x
Simulation study x x x
Simulation example x x x
Example in inlabru x x x

Datasets

All the data sets that are used in the paper can be downloaded manually from the GitHub repository, or directly in R as specified in the data descriptions.

Session info

The code was written and run in R with the following software versions:

inla.version()
R-INLA version ..........: 22.05.07
Date ....................: Sat May 7 12:43:31 PM +03 2022 (Version_22.05.07)
Maintainers .............: Havard Rue <hrue@r-inla.org>
                         : Finn Lindgren <finn.lindgren@gmail.com>
                         : Elias Teixeira Krainski <elias@r-inla.org>
Main web-page ...........: www.r-inla.org
Download-page ...........: inla.r-inla-download.org
Repository ..............: github.com/hrue/r-inla
Email support ...........: help@r-inla.org
                         : r-inla-discussion-group@googlegroups.com
Current session info

─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.2.1 (2022-06-23)
 os       macOS Big Sur ... 10.16
 system   x86_64, darwin17.0
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       Europe/Oslo
 date     2023-09-01
 pandoc   3.1.1 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────
 package      * version  date (UTC) lib source
 class          7.3-20   2022-01-16 [1] CRAN (R 4.2.1)
 classInt       0.4-9    2023-02-28 [1] CRAN (R 4.2.0)
 cli            3.6.1    2023-03-23 [1] CRAN (R 4.2.0)
 codetools      0.2-18   2020-11-04 [1] CRAN (R 4.2.1)
 colorspace     2.1-0    2023-01-23 [1] CRAN (R 4.2.0)
 DBI            1.1.3    2022-06-18 [1] CRAN (R 4.2.0)
 e1071          1.7-13   2023-02-01 [1] CRAN (R 4.2.0)
 fansi          1.0.4    2023-01-22 [1] CRAN (R 4.2.0)
 farver         2.1.1    2022-07-06 [1] CRAN (R 4.2.0)
 foreach      * 1.5.2    2022-02-02 [1] CRAN (R 4.2.0)
 ggplot2        3.4.3    2023-08-14 [1] CRAN (R 4.2.0)
 glue           1.6.2    2022-02-24 [1] CRAN (R 4.2.0)
 gtable         0.3.3    2023-03-21 [1] CRAN (R 4.2.0)
 INLA         * 22.05.07 2022-05-07 [1] local
 inlabru        2.7.0    2022-12-02 [1] CRAN (R 4.2.1)
 isoband        0.2.7    2022-12-20 [1] CRAN (R 4.2.0)
 iterators      1.0.14   2022-02-05 [1] CRAN (R 4.2.0)
 KernSmooth     2.23-20  2021-05-03 [1] CRAN (R 4.2.1)
 labeling       0.4.2    2020-10-20 [1] CRAN (R 4.2.0)
 lattice        0.20-45  2021-09-22 [1] CRAN (R 4.2.1)
 lifecycle      1.0.3    2022-10-07 [1] CRAN (R 4.2.0)
 magrittr       2.0.3    2022-03-30 [1] CRAN (R 4.2.0)
 MASS           7.3-57   2022-04-22 [1] CRAN (R 4.2.1)
 Matrix       * 1.4-1    2022-03-23 [1] CRAN (R 4.2.1)
 MatrixModels   0.5-1    2022-09-11 [1] CRAN (R 4.2.0)
 mgcv           1.8-40   2022-03-29 [1] CRAN (R 4.2.1)
 munsell        0.5.0    2018-06-12 [1] CRAN (R 4.2.0)
 nlme           3.1-157  2022-03-25 [1] CRAN (R 4.2.1)
 patchwork      1.1.2    2022-08-19 [1] CRAN (R 4.2.0)
 pillar         1.9.0    2023-03-22 [1] CRAN (R 4.2.0)
 pkgconfig      2.0.3    2019-09-22 [1] CRAN (R 4.2.0)
 plyr           1.8.8    2022-11-11 [1] CRAN (R 4.2.0)
 proxy          0.4-27   2022-06-09 [1] CRAN (R 4.2.0)
 R6             2.5.1    2021-08-19 [1] CRAN (R 4.2.0)
 RColorBrewer   1.1-3    2022-04-03 [1] CRAN (R 4.2.0)
 Rcpp           1.0.11   2023-07-06 [1] CRAN (R 4.2.0)
 rgdal          1.5-32   2022-05-09 [1] CRAN (R 4.2.0)
 rlang          1.1.1    2023-04-28 [1] CRAN (R 4.2.0)
 s2             1.1.4    2023-05-17 [1] CRAN (R 4.2.0)
 scales         1.2.1    2022-08-20 [1] CRAN (R 4.2.0)
 sf             1.0-14   2023-07-11 [1] CRAN (R 4.2.0)
 sp           * 2.0-0    2023-06-22 [1] CRAN (R 4.2.0)
 tibble         3.2.1    2023-03-20 [1] CRAN (R 4.2.0)
 units          0.8-3    2023-08-10 [1] CRAN (R 4.2.0)
 utf8           1.2.3    2023-01-31 [1] CRAN (R 4.2.0)
 vctrs          0.6.3    2023-06-14 [1] CRAN (R 4.2.0)
 viridisLite    0.4.2    2023-05-02 [1] CRAN (R 4.2.0)
 withr          2.5.0    2022-03-03 [1] CRAN (R 4.2.0)
 wk             0.7.3    2023-05-06 [1] CRAN (R 4.2.0)

 [1] /Library/Frameworks/R.framework/Versions/4.2/Resources/library

──────────────────────────────────────────────────────────────────────────────