knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
Nonparametric Bounds for Regression with Interval-Censored Outcomes
Author: Brenton Kenkel, Vanderbilt University
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)
coefbounds is in an early stage of development. Backward-incompatible API changes are possible until version 1.0.0 is released.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.