dengdetian0603 / baker

Bayesian Analysis Kit for Etiology Research

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

baker: Bayesian Analysis Kit for Etiology Research

An R Package for Fitting Bayesian Nested Partially Latent Class Models

![Gitter](https://badges.gitter.im/Join Chat.svg)

Build Status

How to install?

install.packages("devtools",repos="http://watson.nci.nih.gov/cran_mirror/")
devtools::install_github("zhenkewu/baker")

Note: run install.packages("pbkrtest") for R(>=3.2.3) if this package is reported as missing.

How to run baker graphical user interface?

install.packages("devtools",repos="http://watson.nci.nih.gov/cran_mirror/")
devtools::install_github("zhenkewu/baker")
shiny::runGitHub("baker","zhenkewu",subdir="inst/shiny")

Why should someone use baker?

  • 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 baker.

Details

  1. 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.
  2. baker has 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.
  3. 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.
  4. Reference publication can be found here and here.

How does it compare to other existing solutions?

  • Acknowledges various levels of measurement errors and combines multiple sources of data.

What are the main functions?

  • nplcm() that fits the model with or without covariates.

Platform

  • The baker package 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 gitter button at the top of this README file.

Connect R to JAGS or WinBUGS

Mac OSX 10.11 El Capitan

  1. Use Just Another Gibbs Sampler (JAGS)

  2. Install JAGS 4.2.0; Download here

  3. Install R; Download from here

  4. Fire up R, run R command install.pacakges("rjags")

  5. Run R command 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
  • Run R command library(baker). If the package ks cannot be loaded due to failure of loading package rgl, first install X11 by going here, followed by
    install.packages("http://download.r-forge.r-project.org/src/contrib/rgl_0.95.1504.tar.gz",repo=NULL,type="source")

Unix (Build from source without administrative privilege)

Here we use JHPCE as an example. The complete installation guide offers extra information.

  1. Download source code for JAGS 4.2.0;

  2. Suppose you've downloaded it in ~/local/jags/4.2.0. Follow the bash commands below:

    # 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")
  3. Also check out the INSTALLATION file for rjags package.

Windows

  • JAGS 4.2.0

    1. Install R; Download from here
    2. 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;
    3. Fire up R, run R command install.pacakges("rjags")
    4. Install Rtools (for building and installing R pacakges from source); Add the path to Rtools (e.g. C:\Rtools\) into your environmental variables so that R knows where to find it.
  • WinBUGS 1.4.3

    1. Install the patch
    2. Install the WinBUGS 1.4.x immortality key

Maintainer:

Zhenke Wu (zhwu@jhu.edu)

Department of Biostatistics

Johns Hopkins Bloomberg School of Public Health

About

Bayesian Analysis Kit for Etiology Research

License:Other


Languages

Language:R 99.9%Language:CSS 0.1%Language:JavaScript 0.1%