Learn R Programming

icenReg (version 1.3.5)

imputeCens: Impute Interval Censored Data from icenReg Regression Model

Description

Imputes censored responses from data.

Usage

imputeCens(fit, newdata = NULL, imputeType = "fullSample", numImputes = 5)

Arguments

fit
model fit with ic_par or ic_sp
newdata
data.frame containing covariates and censored intervals. If blank, will use data from model
imputeType
type of imputation. See details for options
numImputes
Number of imputations (ignored if imputeType = "median")

Details

If newdata is left blank, will provide estimates for original data set. There are several options for how to impute. imputeType = 'median' imputes the median time, conditional on the response interval, covariates and regression parameters at the MLE. To get random imputations without accounting for error in the estimated parameters imputeType ='fixedParSample' takes a random sample of the response variable, conditional on the response interval, covariates and estimated parameters at the MLE. Finally, imputeType = 'fullSample' first takes a random sample of the coefficients, (assuming asymptotic normality) and then takes a random sample of the response variable, conditional on the response interval, covariates, and the random sample of the coefficients.

Examples

Run this code

simdata <- simIC_weib(n = 500, b1 = .3, b2 = -.3,
                      inspections = 6, inspectLength = 1)
  
fit <- ic_par(cbind(l, u) ~ x1 + x2,
                   data = simdata)

imputedValues <- imputeCens(fit)

Run the code above in your browser using DataLab