Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

👩‍🍳 🥧 Bayesian Analysis Kit for Etiology Research via Nested Partially Latent Class Models

License

NotificationsYou must be signed in to change notification settings

zhenkewu/baker

Repository files navigation

An R Package for Fitting BayesianNested Partially Latent ClassModels

R build status

Maintainer: Zhenke Wu,zhenkewu@umich.edu

Source Code: Please clickherefor source code on GitHub.

Issues: Please clickhere to report reproducibleissues.

Vignette: Please clickhere to read thelatest long-version vignette; a short version can be foundhere.

Package website: Please clickherefor a website generated bypkgdown, which contains html format of thepackage manual (“Reference”).

References: If you are usingbaker for population and individualestimation from case-control data, please cite the following papers:

Citation
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.
nested pLCMWu, 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.
nested pLCM regressionWu, Z., Chen, I (2021). Probabilistic Cause-of-disease Assignment using Case-control Diagnostic Tests: A Hierarchical Bayesian Approach.Statistics in Medicine 40(4):823-841.
ApplicationMaria 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
Primary PERCH AnalysisThe PERCH Study Group (2019). Aetiology of severe hospitalized pneumonia in HIV-uninfected children from Africa and Asia: the Pneumonia Aetiology Research for Child Health (PERCH) Case-Control Study.The Lancet 394(10200): 757-779.
Software paperChen I, Shi Q, Zeger SL, Wu Z (2022+)baker: AnR package for Nested Partially-Latent Class Models.

There are a number of scientific papers on global health and infectiousdiseases that have used the model and some the software (in its earlierversions). Some notable examples are listed below:

Notable References usingbaker (model and/or software)
1Kubale et al. (2023). Etiology of acute lower respiratory illness hospitalizations among infants in four countries.Open Forum Infectious Diseases, ofad580.
2Saha SK et al. (2018). Causes and incidence of community-acquired serious infections among young children in south Asia (ANISA): an observational cohort study.The Lancet 392(10142):145-159.

Table of content

Installation

# install.packages("devtools",repos="https://cloud.r-project.org")devtools::install_github("zhenkewu/baker")

Note:

  • runinstall.packages("pbkrtest") forR(>=3.2.3) if this package isreported as missing.
  • Windows User: usedevtools::install_github("zhenkewu/baker",INSTALL_opts=c("--no-multiarch"))instead if you see an error messageERROR: loading failed for 'i386'(Thanks Chrissy!).

Vignettes

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::runApp(system.file("shiny",package="baker"))

For developers interested in low-level details, here is a pretty awesomevisualizationof the function dependencies within the package:

library(DependenciesGraphs)# if not installed, try this-- devtools::install_github("datastorm-open/DependenciesGraphs")library(QualtricsTools)# devtools::install_github("emmamorgan-tufts/QualtricsTools")dep<- funDependencies('package:baker','nplcm')plot(dep)

You will get a dynamic figure. A snapshot is below:

Analytic Goal

  • To study disease etiology from case-control data from multiple sourcesthat have measurement errors. If you are interested in estimating thepopulation etiology pie (fraction), and the probability of each causefor individual case, trybaker.

Comparison to Other Existing Solutions

  • Acknowledges various levels of measurement errors and combinesmultiple sources of data for optimal disease diagnosis.
  • Main function:nplcm() that fits the model with or withoutcovariates.

Details

  1. Implements hierarchical Bayesian models to infer disease etiologyfor multivariate binary data. The package builds in functionalitiesfor data cleaning, exploratory data analyses, model specification,model estimation, visualization and model diagnostics andcomparisons, catalyzing vital effective communications betweenanalysts and practicing clinicians.
  2. baker has implemented models for dependent measurements givendisease status, regression analyses of etiology, multiple imperfectmeasurements, different priors for true positive rates among caseswith differential measurement characteristics, and multiple-pathogenetiology.
  3. Scientists inPneumonia Etiology Research for ChildHealth (PERCH) study usuallyrefer to the etiology distribution as “population etiology pie”and “individual etiology pie” for their compositional nature,hence the name of the package.

Platform

  • Thebaker package is compatible with OSX, Linux and Windows systems,each requiring a slightly different setup as described below. If youneed to speed up the installation and analysis, please contact themaintainer or chat by clicking thegitter button at the top of thisREADME file.

ConnectR toJAGS

Mac OSX (10.11+)

  1. UseJust Another Gibbs Sampler(JAGS)
  2. Install JAGS 4.3.2 (or 4.2.0 - currently it is slightly slower for4.3.2, which was updated to be compatible with R 4.3.x); Downloadhere
  3. InstallR; Download fromhere
  4. Fire upR, runR commandinstall.packages("rjags")
  5. RunR commandlibrary(rjags) in R console; If the installationsare successful, you’ll see some notes like this:
>library(rjags)Loadingrequiredpackage:codaLinkedtoJAGS4.x.0Loadedmodules:basemod,bugs
  • RunR commandlibrary(baker). If the packageks cannot be loadeddue to failure of loading packagergl, first install X11 by goinghere, followedby
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 useJHPCE as an example.The completeinstallationguideoffers extra information.

  1. Download source code forJAGS4.2.0;The workflow would be similar for later versions ofJAGS.

  2. Suppose you’ve downloaded it in~/local/jags/4.2.0. Follow thebash 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/usrexport 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 -j8make install# prepare to install R package, rjags:export PKG_CONFIG_PATH=$HOME/local/jags/4.2.0/usr/lib64/pkgconfig module load RR> install.packages("rjags")# or if the above fails, try:R>install.packages("rjags", configure.args="--enable-rpath")
  3. Also check out theINSTALLATIONfile forrjags package.

Submitting Jobs to Computing Cluster via a shell script

Again, I use JHPCE as an example.

#!/bin/bash#$ -M zhenkewu@gmail.com#$ -N baker_regression_perch#$ -o /users/zhwu/baker_regression/data_analysis/baker_regression_test.txt#$ -e /users/zhwu/baker_regression/data_analysis/baker_regression_test.txtexport JAGS_HOME=$HOME/local/jags/4.2.0/usrexport PATH=$JAGS_HOME/bin:$PATHexport LD_LIBRARY_PATH=$JAGS_HOME/lib64cd /users/zhwu/baker_regression/data_analysis#$ -cwdecho"**** Job starts ****"dateecho"**** JHPCE info ****"echo"User:${USER}"echo"Job id:${JOB_ID}"echo"Job name:${JOB_NAME}"echo"Hostname:${HOSTNAME}" Rscript real_regression_data_jhpce.Recho"**** Job ends ****" date

Windows

  • JAGS 4.2.0 (also applicable to later versions)
  1. InstallR; Download fromhere
  2. InstallJAGS4.2.0;Add the path to JAGS 4.2.0 into the environmental variable(essential for R to find the jags program). Seethisfor setting environmental variables;
  • alternatives arebrew install -v jags for OSX,sudo apt-get install jags for Ubuntu/Debian
  1. Fire upR, runR commandinstall.packages("rjags")
  2. InstallRtools(for building and installing R packages from source); Add the pathtoRtools (e.g.,C:\Rtools\) into your environmental variablesso that R knows where to find it.

Example data sets

We provide two simulated data sets in the package:

data(data_nplcm_noreg)

data(data_nplcm_reg_nest)

About

👩‍🍳 🥧 Bayesian Analysis Kit for Etiology Research via Nested Partially Latent Class Models

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors7


[8]ページ先頭

©2009-2025 Movatter.jp