getFitEsts: Get Survival Curve Estimates from icenReg Model

View source: R/user_utilities.R

getFitEstsR Documentation

Get Survival Curve Estimates from icenReg Model

Description

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

Usage

getFitEsts(fit, newdata = NULL, p, q)

Arguments

fit

model fit with ic_par or ic_sp

newdata

data.frame containing covariates

p

Percentiles

q

Quantiles

Details

For the ic_sp and ic_par, the MLE estimate is returned. For ic_bayes, the MAP estimate is returned. To compute the posterior means, use sampleSurv.

If newdata is left blank, baseline estimates will be returned (i.e. all covariates = 0). If p is provided, will return the estimated Q(p | x), where Q is the inverse of F. 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.

Author(s)

Clifford Anderson-Bergman

Examples

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)

icenReg documentation built on May 29, 2024, 5:32 a.m.