knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

coefbounds

Travis-CI Build Status codecov

Nonparametric Bounds for Regression with Interval-Censored Outcomes

Author: Brenton Kenkel, Vanderbilt University

Installation

coefbounds is not yet available on CRAN. To install directly from GitHub:

if (!require("devtools")) {
    install.packages("devtools")
    library("devtools")
}

devtools::install_github("brentonk/coefbounds", build_vignettes = TRUE)

Note

coefbounds is in an early stage of development. Backward-incompatible API changes are possible until version 1.0.0 is released.

Usage

Below are some simple usage examples. For more fleshed-out examples, see the package vignette: vignette("introduction", package = "coefbounds").

library("coefbounds")

I'll begin by generating some simple data with an interval-censored outcome.

set.seed(97)
x1 <- rnorm(100)
x2 <- rnorm(100)
y <- 1 - x1 + x2 + rnorm(100)
lwr <- floor(y)
upr <- ceiling(y)

To estimate coefficient bounds, use coefbounds() with a formula of the form yl + yu ~ x1 + x2 + ..., where yl is the lower bound on each response value and yu is the upper bound.

fit_full <- coefbounds(lwr + upr ~ x1 + x2, boot = 100)
fit_full

For inference, make sure coefbounds() is run with boot > 0 and use interval_hypothesis() or confint().

interval_hypothesis(fit = fit_full,
                    term = "x1",
                    interval = c(0, 0),
                    type = "subset")
interval_hypothesis(fit = fit_full,
                    term = "x2",
                    interval = c(0.7, 1.6),
                    type = "equal")
confint(fit_full, level = 0.99)

To Do



brentonk/coefbounds documentation built on May 13, 2019, 5:09 a.m.