Learn R Programming

coarseDataTools

This is the repository for the coarseDataTools R package. We use this as a development space. The most recent, stable version of the package can be downloaded either from CRAN (https://cran.r-project.org/package=coarseDataTools) or from the most recent release version on github (https://github.com/nickreich/coarseDataTools/releases).

This package contains functions to analyze coarsely observed data. Specifically, it contains functions to (1) fit parametric accelerated failure time models to interval-censored survival time data, and (2) estimate the case-fatality ratio in scenarios with underreporting. This package's development was motivated by applications to infectious disease: in particular, problems with estimating the incubation period and the case fatality ratio of a given disease. Sample data files are included in the package.

As of March 2016, coarseDataTools imports functions from the MCMCpack package, which in turn imports functions from the graph and Rgraphviz packages. Both of these packages have been removed from CRAN, but can be installed from Bioconductor using the following code:

source("https://bioconductor.org/biocLite.R")
biocLite("graph")
biocLite("Rgraphviz")

Copy Link

Version

Install

install.packages('coarseDataTools')

Monthly Downloads

1,789

Version

0.7.2

License

GPL (>= 2)

Maintainer

Nicholas G. Reich

Last Published

April 11th, 2025

Functions in coarseDataTools (0.7.2)

loglikhd

Negative log likelihood for a dataset of interval-censored data, given a distribution and its parameters.
simulated.outbreak.deaths

Simulated case and death reports from a fictional outbreak
precision.simulation

Simulate incubation period analyses with coarse data
mcmc.erlang

Does a metropolis hastings for the Erlang distribution
mcmcpack.ll

posterior log likelihood function to pass to MCMCpack sampler
nycH1N1

Incubation period data from New York City Public Schools, 2009 H1N1 influenza outbreak
get.obs.type

Tries to guess the observation types (SIC, DIC, or exact).
exp.win.lengths

Exposure window lengths from an influenza outbreak at a NYC school
logLik,cd.fit-method

Get the log-likelihood value of a cd.fit or cd.fit.mcmc object
cd.fit.mcmc

An S4 Class that stores a MCMC fit coarse data object
dgammaOff1

Function that calculates dgamma with a offset of 1 (i.e., 1 is equivalent to 0)
dic.fit.mcmc

Fits the distribution to the passed-in data using MCMC as implemented in MCMCpack.
cd.fit

An S4 Class that stores a fitted coarse data object
dic.fit

censored survival data
pgammaOff1

Function that calculates pgamma with a offset of 1 (i.e., 1 is equivalent to 0)
EMforCFR

A function to estimate the relative case fatality ratio when reporting rates are time-varying and deaths are lagged because of survival time.
fluA.inc.per

Coarse incubation period data for influenza A