baker: Bayesian Analysis Kit for Etiology Research
An R Package for Fitting Bayesian Nested Partially Latent Class Models
Maintainer: Zhenke Wu, email@example.com
References: If you are using baker for population and individual estimation from case-control data, please cite the following paper:
|partially Latent Class Models (pLCM)||Wu, Z., Deloria-Knoll, M., Hammitt, L. L., Zeger, S. L. and the Pneumonia Etiology Research for Child Health Core Team (2016), Partially latent class models for case–control studies of childhood pneumonia aetiology. J. R. Stat. Soc. C, 65: 97–114. doi:10.1111/rssc.12101||Link|
|nested pLCM||Wu, Z., Deloria-Knoll, M., Zeger, S.L.; Nested partially latent class models for dependent binary data; estimating disease etiology. Biostatistics 2017; 18 (2): 200-213. doi: 10.1093/biostatistics/kxw037||Link|
|Application||Maria Deloria Knoll, Wei Fu, Qiyuan Shi, Christine Prosperi, Zhenke Wu, Laura L. Hammitt, Daniel R. Feikin, Henry C. Baggett, Stephen R.C. Howie, J. Anthony G. Scott, David R. Murdoch, Shabir A. Madhi, Donald M. Thea, W. Abdullah Brooks, Karen L. Kotloff, Mengying Li, Daniel E. Park, Wenyi Lin, Orin S. Levine, Katherine L. O’Brien, Scott L. Zeger; Bayesian Estimation of Pneumonia Etiology: Epidemiologic Considerations and Applications to the Pneumonia Etiology Research for Child Health Study, Clinical Infectious Diseases, Volume 64, Issue suppl_3, 15 June 2017, Pages S213–S227||Link|
Table of content
- 1. Installation
- 2. Vignettes
- 3. Graphical User Interface (GUI)
- 4. Analytic Goal
- 5. Comprison to Other Existing Solutions
- 6. Details
- 7. Platform
- 8. Connect
# install.packages("devtools",repos="https://cloud.r-project.org") devtools::install_github("zhenkewu/baker")
R(>=3.2.3) if this package is reported
devtools::install_github("zhenkewu/baker", build_vignettes=TRUE) # will take extra time to run a few examples. browseVignettes("baker")
Graphical User Interface (GUI)
# install.packages("devtools",repos="http://watson.nci.nih.gov/cran_mirror/") devtools::install_github("zhenkewu/baker") shiny::runGitHub("baker","zhenkewu",subdir="inst/shiny")
- To study disease etiology from case-control data from multiple sources that have measurement errors. If you are interested in estimating the population etiology pie (fraction), and the probability of each cause for individual case, try
Comprison to Other Existing Solutions
- Acknowledges various levels of measurement errors and combines multiple sources of data for optimal disease diagnosis.
- Main function:
nplcm()that fits the model with or without covariates.
- Implements hierarchical Bayesian models to infer disease etiology for multivariate binary data. The package builds in functionalities for data cleaning, exploratory data analyses, model specification, model estimation, visualization and model diagnostics and comparisons, catalyzing vital effective communications between analysts and practicing clinicians.
bakerhas implemented models for dependent measurements given disease status, regression analyses of etiology, multiple imperfect measurements, different priors for true positive rates among cases with differential measurement characteristics, and multiple-pathogen etiology.
- Scientists in Pneumonia Etiology Research for Child Health (PERCH) study usually refer to the etiology distribution as "population etiology pie" and "individual etiology pie" for their compositional nature, hence the name of the package.
bakerpackage is compatible with OSX, Linux and Windows systems, each requiring a slightly different setup as described below. If you need to speed up the installation and analysis, please contact the maintainer or chat by clicking the
gitterbutton at the top of this README file.
Mac OSX 10.11 El Capitan
Install JAGS 4.2.0; Download here
R; Download from here
library(rjags)in R console; If the installations are successfull, you'll see some notes like this:
>library(rjags) Loading required package: coda Linked to JAGS 4.x.0 Loaded modules: basemod,bugs
library(baker). If the package
kscannot be loaded due to failure of loading package
rgl, first install X11 by going here, followed by
Unix (Build from source without administrative privilege)
Download source code for JAGS 4.2.0;
Suppose you've downloaded it in
~/local/jags/4.2.0. Follow the bash commands below:
# change to the directory with the newly downloaded source files: cd ~/local/jags/4.2.0 # create a new folder named "usr" mkdir usr # decompress files: tar zxvf JAGS-4.2.0.tar.gz # change to the directory with newly decompressed files: cd ~/local/jags/4.2.0/JAGS-4.2.0 # specify new JAGS home: export JAGS_HOME=$HOME/local/jags/4.2.0/usr export PATH=$JAGS_HOME/bin:$PATH # link to BLAS and LAPACK: # Here I have used "/usr/lib64/atlas/" and "/usr/lib64/" on JHPCE that give me # access to libblas.so.3 and liblapack.so.3. Please modify to paths on your system. LDFLAGS="-L/usr/lib64/atlas/ -L/usr/lib64/" ./configure --prefix=$JAGS_HOME --libdir=$JAGS_HOME/lib64 # if you have 8 cores: make -j8 make install # prepare to install R package, rjags: export PKG_CONFIG_PATH=$HOME/local/jags/4.2.0/usr/lib64/pkgconfig module load R R> install.packages("rjags")
Also check out the INSTALLATION file for
R; Download from here
- Install JAGS 4.2.0; Add the path to JAGS 4.2.0 into the environmental variable (essential for R to find the jags program). See this for setting environmental variables;
- Fire up
Rtools(for building and installing R pacakges from source); Add the path to
C:\Rtools\) into your environmental variables so that R knows where to find it.