Learn R Programming

icenReg (version 1.3.5)

getFitEsts: Get Estimates from icenReg Regression Model

Description

Gets probability or quantile estimates from a ic_par or ic_sp object. Provided estimates conditional on regression parameters found in newdata.

Usage

getFitEsts(fit, newdata, p, q)

Arguments

fit
model fit with ic_par or ic_sp
newdata
data.frame containing covariates
p
percentiles
q
quantiles

Details

If newdata is left blank, baseline estimates will be returned (i.e. all covariates = 0). If p is provided, will return the estimated F^-1(p | x). If q is provided, will return the estimated F(q | x). If neither p nor q are provided, the estimated conditional median is returned. In the case of ic_sp, the MLE of the baseline survival is not necessarily unique, as probability mass is assigned to disjoint Turnbull intervals, but the likelihood function is indifferent to how probability mass is assigned within these intervals. In order to have a well defined estimate returned, we assume probability is assigned uniformly in these intervals. In otherwords, we return *a* maximum likelihood estimate, but don't attempt to characterize *all* maximum likelihood estimates with this function. If that is desired, all the information needed can be extracted with getSCurves.

Examples

Run this code
  simdata <- simIC_weib(n = 500, b1 = .3, b2 = -.3,
                        inspections = 6, inspectLength = 1)
  fit <- ic_par(Surv(l, u, type = 'interval2') ~ x1 + x2,
                data = simdata)
  new_data <- data.frame(x1 = c(1,2), x2 = c(-1,1))
  rownames(new_data) <- c('grp1', 'grp2')
  
  estQ <- getFitEsts(fit, new_data, p = c(.25, .75))
  
  estP <- getFitEsts(fit, q = 400)

Run the code above in your browser using DataLab