Package bhrcr. November 12, 2018

Similar documents
Package effectfusion

Package SK. May 16, 2018

Package testassay. November 29, 2016

Package ICBayes. September 24, 2017

Package EMVS. April 24, 2018

Package LBLGXE. R topics documented: July 20, Type Package

Package horseshoe. November 8, 2016

Package RTransferEntropy

Package aspi. R topics documented: September 20, 2016

Package idmtpreg. February 27, 2018

Package leiv. R topics documented: February 20, Version Type Package

Package rnmf. February 20, 2015

Package Tcomp. June 6, 2018

Package RootsExtremaInflections

Package basad. November 20, 2017

Package bayeslm. R topics documented: June 18, Type Package

Package SimSCRPiecewise

Package TimeSeries.OBeu

Package gwqs. R topics documented: May 7, Type Package. Title Generalized Weighted Quantile Sum Regression. Version 1.1.0

Package BNN. February 2, 2018

Package gk. R topics documented: February 4, Type Package Title g-and-k and g-and-h Distribution Functions Version 0.5.

Package polypoly. R topics documented: May 27, 2017

Package beam. May 3, 2018

Package gtheory. October 30, 2016

Package ZIBBSeqDiscovery

Package jmcm. November 25, 2017

Package sbgcop. May 29, 2018

Package depth.plot. December 20, 2015

Package ARCensReg. September 11, 2016

Package factorqr. R topics documented: February 19, 2015

Package RSwissMaps. October 3, 2017

Package TwoStepCLogit

Package mbvs. August 28, 2018

Package IGG. R topics documented: April 9, 2018

Package survidinri. February 20, 2015

Package varband. November 7, 2016

Package bigtime. November 9, 2017

Package SMFilter. December 12, 2018

Package metafuse. October 17, 2016

Package scpdsi. November 18, 2018

Package hds. December 31, 2016

Package SimCorMultRes

Package icmm. October 12, 2017

Package locfdr. July 15, Index 5

Package ltsbase. R topics documented: February 20, 2015

Package spatial.gev.bma

Package sscor. January 28, 2016

Package HIMA. November 8, 2017

Package pssm. March 1, 2017

Package MicroMacroMultilevel

Package robustrao. August 14, 2017

Package covsep. May 6, 2018

Package BayesTreePrior

Package reinforcedpred

Package r2glmm. August 5, 2017

Luke B Smith and Brian J Reich North Carolina State University May 21, 2013

Package convospat. November 3, 2017

Package invgamma. May 7, 2017

Package mmm. R topics documented: February 20, Type Package

Package RATest. November 30, Type Package Title Randomization Tests

Package noncompliance

Package ICGOR. January 13, 2017

Package gma. September 19, 2017

Package netdep. July 10, 2018

Package Delaporte. August 13, 2017

Package CoxRidge. February 27, 2015

Package womblr. September 12, 2017

Package drgee. November 8, 2016

Package GORCure. January 13, 2017

Package SEMModComp. R topics documented: February 19, Type Package Title Model Comparisons for SEM Version 1.0 Date Author Roy Levy

Package thief. R topics documented: January 24, Version 0.3 Title Temporal Hierarchical Forecasting

Package krige. August 24, 2018

Package SightabilityModel

Package causalweight

Package threg. August 10, 2015

Package rgabriel. February 20, 2015

Package ShrinkCovMat

Package kgc. December 21, Version Date Title Koeppen-Geiger Climatic Zones

Package FinCovRegularization

The evdbayes Package

Package NlinTS. September 10, 2018

Package nardl. R topics documented: May 7, Type Package

Package MAVE. May 20, 2018

Package Select. May 11, 2018

Package hurdlr. R topics documented: July 2, Version 0.1

Package countyweather

Package Perc. R topics documented: December 5, Type Package

Package funrar. March 5, 2018

Package accelmissing

Package BayesNI. February 19, 2015

Package breakaway. R topics documented: March 30, 2016

Package plspolychaos

Package ensemblepp. R topics documented: September 20, Title Ensemble Postprocessing Data Sets. Version

Package RcppSMC. March 18, 2018

Package MultisiteMediation

Package covtest. R topics documented:

Package MonoPoly. December 20, 2017

Package RZigZag. April 30, 2018

The nltm Package. July 24, 2006

Package MAPA. R topics documented: January 5, Type Package Title Multiple Aggregation Prediction Algorithm Version 2.0.4

Transcription:

Type Package Package bhrcr November 12, 2018 Title Bayesian Hierarchical Regression on Clearance Rates in the Presence of Lag and Tail Phases Version 1.0.2 Date 2018-11-12 Author Colin B. Fogarty [cre] <cfogarty@mit.edu>, Saeed Sharifi-Malvajerdi [aut] <saeedsh@wharton.upenn.edu>, Feiyu Zhu [aut] <feiyuzhu@sas.upenn.edu> Maintainer Colin B. Fogarty <cfogarty@mit.edu> An implementation of the Bayesian Clearance Estimator (Fogarty et al. (2015) <doi:10.1111/biom.12307>). It takes serial measurements of a response on an individual (e.g., parasite load after treatment) that is decaying over time and performs Bayesian hierarchical regression of the clearance rates on the given covariates. This package provides tools to calculate WWARN PCE (WorldWide Antimalarial Resistance Network's Parasite Clearance Estimator) estimates of the clearance rates as well. Depends R (>= 3.0.0) Imports stats, MCMCpack, MASS, msm, mvtnorm, survival, AER, Cairo, graphics, grdevices, utils Suggests knitr, rmarkdown VignetteBuilder knitr License GPL-3 RoxygenNote 6.1.0 NeedsCompilation no Repository CRAN Date/Publication 2018-11-12 15:50:04 UTC R topics documented: bhrcr-package........................................ 2 calculatepce........................................ 2 1

2 calculatepce clearanceestimatorbayes.................................. 4 diagnostics......................................... 7 plot.bhrcr.......................................... 8 posterior........................................... 9 print.bhrcr.......................................... 9 pursat............................................ 10 pursat_covariates...................................... 11 summary.bhrcr....................................... 11 Index 13 bhrcr-package Bayesian Hierarchical Regression on Clearance Rates "bhrcr" provides tools for calculating, analyzing, and visualizing parasite clearance rates in the presence of "lag" and "tail" phases through the use of a Bayesian hierarchical linear model. The main function for the Bayesian hierarchical linear model is clearanceestimatorbayes. Also the function calculatepce performs the method presented in Flegg et al (2011). The hierarchical approach enables us to appropriately incorporate the uncertainty in both estimating clearance rates in patients and assessing the potential impact of covariates on these rates into the posterior intervals generated for the parameters associated with each covariate. Furthermore, it permits users to incorporate information about individuals for whom there exists only one observation time before censoring, which alleviates a systematic bias affecting inference when these individuals are excluded. The detailed model and simulation study are presented in the paper "Bayesian Hierarchical Regression on Clearance Rates in the Presence of Lag and Tail Phases with an Application to Malaria Parasites" by Fogarty et al. (2015). References Flegg, J. A., Guerin, P. J., White, N. J., & Stepniewska, K. (2011). Standardizing the measurement of parasite clearance in falciparum malaria: the parasite clearance estimator. Malaria journal, 10(1), 339. Fogarty, C. B., Fay, M. P., Flegg, J. A., Stepniewska, K., Fairhurst, R. M., & Small, D. S. (2015). Bayesian hierarchical regression on clearance rates in the presence of "lag" and "tail" phases with an application to malaria parasites. Biometrics, 71(3), 751-759. calculatepce WWARN Parasite Clearance Estimator (PCE) This function is a wrapper function of the WWARN PCE method to calculate the parasite clearance rates of a given data set of patient profiles. The function returns the output data frame and it also saves more comprehensive outputs under a folder named "PceEstimates" under the current working directory.

calculatepce 3 calculatepce(data, detect.limit = 15, outlier.detect = TRUE,...) Arguments data Details Value detect.limit a data frame containing the profiles of patients. This data frame must contain id, time, and count columns, in that order. The first column represents the IDs of patients. The second and third columns contain parasite measurements (per microliter) in different times. detection limit of the parasite density in blood outlier.detect indicator of whether or not to use Flegg s outlier detection method... additional parameters. This function gives users a way to calculate the parasite clearance rates by using the method in Flegg et al. (2011). Users can compare the results with that given by our method of Bayesian heierarchical model. The output is saved under a folder named "PceEstimates" under the current working directory. data should be a data frame in the form of the example data pursat provided in this package. detect.limit is the detection limit of the parasite density in blood. The default value is set to be 15. outlier.detect is an indicator users can turn off if the dataset has already been cleaned. Otherwise, it is always recommended to set outlier.detect = TRUE to let the program automatically detect outliers in the dataset. All results are saved under a folder named "PceEstimates" under the current working directory. output Output data frame. If outlier.detect = TRUE, the cleaned data frame will be returned. Author(s) Colin B. Fogarty <cfogarty@mit.edu>, Saeed Sharifi-Malvajerdi <saeedsh@wharton.upenn.edu>, Feiyu Zhu <feiyuzhu@sas.upenn.edu> References Flegg, J. A., Guerin, P. J., White, N. J., & Stepniewska, K. (2011). Standardizing the measurement of parasite clearance in falciparum malaria: the parasite clearance estimator. Malaria journal, 10(1), 339. Examples output <- calculatepce(data = pursat, detect.limit = 15, outlier.detect = TRUE)

4 clearanceestimatorbayes clearanceestimatorbayes Bayesian Hierarchical Regression on Clearance Rates clearanceestimatorbayes estimates the parasite clearance rates by using a Bayesian hierarchical model. Moreover, it provides regression analysis of clearance rates on given covariates. clearanceestimatorbayes(data, covariates = NULL, seed = 1234, detect.limit = 40, outlier.detect = TRUE, conf.level = 0.95, niteration = 1e+05, burnin = 500, thin = 50, filename = "output.csv") Arguments data covariates seed detect.limit a data frame containing the profiles of patients. This data frame must contain id, time, and count columns, in that order. The first column represents the IDs of patients. The second and third columns contain parasite measurements (per microliter) in different times. an optional data frame containing individual level covariates. This argument may be NULL, in which case estimation of clearance rates is of primary interest. a user-specified number used to initialize a pseudorandom number generator. The default value is set to be 1234 for reproducibility. If seed = NULL, then its value will be automatically obtained from the system clock. detection limit of the parasite density in blood (parasites per microliter) outlier.detect indicator of whether or not to use Flegg s outlier detection method. outlier.detect = TRUE is recommended. conf.level niteration burnin thin Details filename required confidence level for reporting credible intervals total number of simulations after the burn-in period length of the burn-in period in the MCMC used in clearanceestimatorbayes step size of the thinning process in the MCMC used in clearanceestimatorbayes the name of the csv file used to store some output elements. This file contains id, clearance.mean, lag.median, and tail.median. This function estimates parasite clearance rates, along with the effect of covariates on them, by using the Bayesian hierarchical model which was introduced in Fogarty et al. (2015). A change point model is used on the log of the parasite densities to account for three potential phases: (1) a constant phase (the lag phase); (2) a phase with a linear decrease (decay phase); (3) another constant phase (the tail phase). Hence the estimation of the parasite clearance rate is only based on observations within the decay phase. The Bayesian approach allows us to treat the delineation

clearanceestimatorbayes 5 Value between lag, decay, and tail phases within an individual s clearance profile as themselves being random variables, thus taking into account the additional uncertainty of boundaries between phases. Details are in Fogarty et al. (2015). The function summary (i.e., summary.bhrcr) can be used to obtain a summary of the results. clearanceestimatorbayes returns an object of class "bhrcr" which is a list containing: CALL function call clearance.post posterior distributions of clearance rates clearance.mean mean values of the posterior distributions of clearance rates clearance.median median values of the posterior distributions of clearance rates intercept.post posterior distributions of the intercepts (alpha_i s) in the model gamma.post posterior distribution of gamma gamma.post.thin thinned posterior sample of gamma gamma.mean gamma.median mean values of the posterior distribution of gamma median values of the posterior distribution of gamma gamma.ci Credible intervals for gamma halflifeslope.post posterior distribution for the effect of covariates on log half-lives halflifeslope.mean mean values of the posterior distribution for the effect of covariates on log halflives halflifeslope.median median values of the posterior distribution for the effect of covariates on log half-lives halflifeslope.ci Credible intervals for the effect of covariates on log half-lives predicted.pce eta.post PCE estimates posterior distribution of eta changelag.post posterior distributions of changetime between lag and decay phases changetail.post posterior distributions of changetime between decay and tail phases lag.median median values of the posterior distributions of changetime between lag and decay phases tail.median median values of the posterior distributions of changetime between decay and tail phases var.epsilon.post posterior variance of epsilon after simulation var.error.post thinned posterior sample of variance of epsilon

6 clearanceestimatorbayes var.alpha.post posterior distribution of variance of alpha var.beta.post index counts posterior distribution of variance of beta a list containing each patient s indices in the data Original parasite counts of all patients counts.current Parasite counts of all patients after sampling censored measurements t.overall p.lag p.lag.thin p.tail p.tail.thin var1.post var2.post mu1.post mu2.post detect.limit lag.post lag2.post theta.post theta2.post burnin measurement times of all patients posterior value of the priori probability of there being a lag phase after simulation thinned posterior sample of the priori probability of there being a lag phase posterior value of the priori probability of there being a tail phase after simulation thinned posterior sample of the priori probability of there being a tail phase posterior distribution of c^2 posterior distribution of d^2 posterior distribution of a posterior distribution of b the detection limit of parasitemia posterior distributions of index of changetime between lag and decay phases posterior distributions of index of changetime between decay and tail phases posterior distributions of log-parasite-count s mean in lag phase posterior distributions of log-parasite-count s mean in tail phase length of the burn-in period Author(s) Colin B. Fogarty <cfogarty@mit.edu>, Saeed Sharifi-Malvajerdi <saeedsh@wharton.upenn.edu>, Feiyu Zhu <feiyuzhu@sas.upenn.edu> References Flegg, J. A., Guerin, P. J., White, N. J., & Stepniewska, K. (2011). Standardizing the measurement of parasite clearance in falciparum malaria: the parasite clearance estimator. Malaria journal, 10(1), 339. Fogarty, C. B., Fay, M. P., Flegg, J. A., Stepniewska, K., Fairhurst, R. M., & Small, D. S. (2015). Bayesian hierarchical regression on clearance rates in the presence of "lag" and "tail" phases with an application to malaria parasites. Biometrics, 71(3), 751-759.

diagnostics 7 Examples data("pursat_covariates") out <- clearanceestimatorbayes(data = pursat, covariates = pursat_covariates, outlier.detect = TRUE, niteration = 200, burnin = 50, thin = 10) diagnostics Diagnostics Function for MCMC diagnostics provides diagnostic analysis for the MCMC process used in the main function clearanceestimatiorbayes. diagnostics(object,...) Arguments object an object of class bhrcr, given by clearanceestimatorbayes.... additional parameters. Details This function provides diagnostic analysis such as trace plots, ACF and PACF plots for some important parameters in the simulation process of Gibbs sampling. With these diagnostic plots, we can be assured that we get the results after we have reached stationarity and have thinned sufficiently. Value the directory location under which all the output is saved. Author(s) Colin B. Fogarty <cfogarty@mit.edu>, Saeed Sharifi-Malvajerdi <saeedsh@wharton.upenn.edu>, Feiyu Zhu <feiyuzhu@sas.upenn.edu>

8 plot.bhrcr Examples data("posterior") diagnostics(posterior) data("pursat_covariates") out <- clearanceestimatorbayes(data = pursat, covariates = pursat_covariates, niteration = 200, burnin = 50, thin = 10) diagnostics(out) plot.bhrcr Bayesian Clearance Estimator Plotting plot.bhrcr plots the posterior results from clearanceestimatorbayes. ## S3 method for class 'bhrcr' plot(x, plot.post = T, id.plot = NULL, thin = NULL,...) Arguments x plot.post id.plot thin Details Value output given by clearanceestimatorbayes indicator of whether or not the posterior samples should be plotted patients IDs an optional vector showing which posterior samples to be plotted... additional arguments passed to the plot.bhrcr function This function plots clearance profile of each individual along with their fitted Bayesian model, Flegg s PCE estimates, and posterior samples. the directory location under which all the plots are saved. Author(s) Colin B. Fogarty <cfogarty@mit.edu>, Saeed Sharifi-Malvajerdi <saeedsh@wharton.upenn.edu>, Feiyu Zhu <feiyuzhu@sas.upenn.edu>

posterior 9 Examples data("posterior") plot(posterior) data("pursat_covariates") out <- clearanceestimatorbayes(data = pursat, covariates = pursat_covariates, niteration = 200, burnin = 50, thin = 10) plot(out) posterior of the Dataset posterior.rda Format The output given by clearanceestimatorbayes in the slow demo example, which is calculated and saved ahead of time to save users time. data("posterior") A data frame of class "bhrcr". print.bhrcr Print Function for the Bayesian Clearance Estimator print.bhrcr prints the estimated effect of covariates on both log clearance rates and log half-lives. ## S3 method for class 'bhrcr' print(x,...) Arguments x an object of class bhrcr, given by clearanceestimatorbayes.... additional parameters.

10 pursat Details Value This function prints the posterior mean value of gamma, which represents the effect of covariates on log clearance rates. It also prints the estimated impact of covariates on log half-lives. the input object is returned silently. Author(s) Colin B. Fogarty <cfogarty@mit.edu>, Saeed Sharifi-Malvajerdi <saeedsh@wharton.upenn.edu>, Feiyu Zhu <feiyuzhu@sas.upenn.edu> Examples data("posterior") print(posterior) data("pursat_covariates") out <- clearanceestimatorbayes(data = pursat, covariates = pursat_covariates, niteration = 200, burnin = 50, thin = 10) print(out) pursat of the Dataset pursat.rda Format The pursat dataset consists of P. falciparum clearance profiles of 110 patients, measured in 2009 and 2010 in the Pursat province of Western Cambodia. Parasite densities were measured every 6 hours, and the detection limit was 15 parasites per microliter. All 110 individuals were observed until no parasites were found in their blood. A data frame with following variables id patients IDs time measurement times count parasite counts in blood

pursat_covariates 11 pursat_covariates of the Dataset pursat_covariates.rda Individual level covariates of patients in the pursat dataset. data("pursat_covariates") Format A data frame with following variables Sex A factor variable with two levels F and M agegroup 21+ (21 years of age or older), or 21- (younger than 21 years) vvkv whether or not an individual was from Veal Veng or Kranvanh HbE the number of alleles of Hemoglobin E variant athal the number of alleles of alpha-thalassaemia variant g6pd the number of alleles of G6PD deficient variant lnpf0 Log initial parasite density year2010 TRUE if 2010, FALSE if 2009 group 1 if group 1, 0 if group 2 summary.bhrcr Summary Statistics for the Bayesian Clearance Estimator summary.bhrcr provides summary statistics for the effect of covariates on both log clearance rates and log half-lives. ## S3 method for class 'bhrcr' summary(object,...) Arguments object an object of class bhrcr, given by clearanceestimatorbayes.... additional parameters.

12 summary.bhrcr Details Value This function provides mean, median, and credible intervals for gamma, which represents the effect of covariates on log clearance rates. It also provides those statistics for the effect of covariates on log half-lives. the input object is returned silently. Author(s) Colin B. Fogarty <cfogarty@mit.edu>, Saeed Sharifi-Malvajerdi <saeedsh@wharton.upenn.edu>, Feiyu Zhu <feiyuzhu@sas.upenn.edu> Examples data("posterior") summary(posterior) data("pursat_covariates") out <- clearanceestimatorbayes(data = pursat, covariates = pursat_covariates, niteration = 200, burnin = 50, thin = 10) summary(out)

Index Topic datasets posterior, 9 pursat, 10 pursat_covariates, 11 bhrcr (bhrcr-package), 2 bhrcr-package, 2 calculatepce, 2, 2 clearanceestimatorbayes, 2, 4 diagnostics, 7 plot.bhrcr, 8 posterior, 9 print.bhrcr, 9 pursat, 10 pursat_covariates, 11 summary, 5 summary.bhrcr, 5, 11 13