SurvRegCens {SurvRegCensCov} | R Documentation |
Weibull Survival Regression Model with a censored covariate
Description
Computes estimators for the shape and scale parameter of the Weibull distribution, as well as for the vector of regression parameters in a parametric survival model with potentially right-censored time-to-event endpoint distributed according to a Weibull distribution. The regression allows for one potentially interval-censored and an arbitrary number of non-censored covariates.
Usage
SurvRegCens(formula, data = parent.frame(), Density, initial, conf.level = 0.95,
intlimit = 10^-10, namCens = "VarCens", trace = 0, reltol = 10^-8)
Arguments
formula |
A formula expression as for other regression models. The response has to be a survival object for right-censored data, as returned by the |
data |
A data frame in which to interpret the variables named in the formula argument. |
Density |
Density function of the censored covariate. |
initial |
Initial values for the parameters to be optimized over, ordered according to Scale parameter, Shape parameter, regression parameters (i.e. |
conf.level |
Confidence level of confidence intervals. |
intlimit |
In computation of integrals, values of the function to be integrated below |
namCens |
Name of censored covariate, to tidy outputs. |
trace |
|
reltol |
|
Details
The time-to-event distributed according to a Weibull distribution, i.e. time-to-event \sim
Weibull(\lambda,\gamma)
, has conditional density given by,
f_{Y_i}(t|\mathbf{x}_i,\boldsymbol{\beta}) =\gamma \lambda t^{\gamma-1} \exp\left(\mathbf{x}_i\boldsymbol{\beta}\right)\exp\left( - \lambda t^{\gamma} \exp\left(\mathbf{x}_i\boldsymbol{\beta}\right) \right),
conditional hazard function given by,
h_i(t|\mathbf{x}_i,\boldsymbol{\beta})= \lambda \gamma t^{\gamma-1} \exp\left( \mathbf{x}_i\boldsymbol{\beta} \right),
and conditional survival function given by,
S_i(t|\mathbf{x}_i,\boldsymbol{\beta}) = \exp\left(-\lambda t^{\gamma} \exp\left(\mathbf{x}_i\boldsymbol{\beta}\right)\right),
where \mathbf{x}_i
collects the values of each covariate for observation i
and \boldsymbol{\beta}
represents the regression parameters.
Value
SurvRegCens
returns an object of class "src"
, a list containing the
following components:
coeff |
Estimators, confidence intervals, |
percent.cens |
Percentage of censored observations in the censored covariate. |
loglik |
Log-likelihood function value at the estimators. |
info.converg |
Convergence information provided by the function |
info.converg.message |
Message provided by |
The methods print.src
, summary.src
, coef.src
, and logLik.src
are used to print or obtain a summary, coefficients, or the value of the log-likelihood at the maximum.
Author(s)
Stanislas Hubeaux, stan.hubeaux@bluewin.ch
Kaspar Rufibach, kaspar.rufibach@gmail.com
http://www.kasparrufibach.ch
References
Hubeaux, S. (2013). Parametric Surival Regression Model with left- and/or interval-censored covariate. Technical report, Biostatistics Oncology, F. Hoffmann-La Roche Ltd.
Hubeaux, S. and Rufibach, K. (2014). SurvRegCensCov: Weibull Regression for a Right-Censored Endpoint with a Censored Covariate. Preprint, https://arxiv.org/abs/1402.0432.
Sattar, A., Sinha, S. K. and Morris, N. J. (2012). A Parametric Survival Model When a Covariate is Subject to Left-Censoring. Biometrics & Biostatistics, S3(2).
Examples
## Not run:
## --------------------------------------------------------------
## 1 censored-covariate and 2 non-censored covariates
## no censoring, to compare result with survival::survreg
## modify prop.cens to introduce left-censoring of covariate
## --------------------------------------------------------------
set.seed(158)
n <- 100
lambda <- exp(-2)
gamma <- 1.5
## vector of regression parameters: the last entry is the one for the censored covariate
beta <- c(0.3, -0.2, 0.25)
true <- c(lambda, gamma, beta)
## non-censored covariates
var1 <- rnorm(n, mean = 4, sd = 0.5)
var2 <- rnorm(n, mean = 4, sd = 0.5)
## Generate censored covariate.
## For generation of Weibull survival times, do not left-censor it yet.
var3 <- rnorm(n, mean = 5, sd = 0.5)
## simulate from a Weibull regression model
time <- TimeSampleWeibull(covariate_noncens = data.frame(var1, var2),
covariate_cens = var3, lambda = lambda, gamma = gamma, beta = beta)
## left-censor covariate
## prop.cens specifies the proportion of observations that should be left-censored
prop.cens <- 0
LOD <- qnorm(prop.cens, mean = 5, sd = 0.5)
var3.cens <- censorContVar(var3, LLOD = LOD)
## censor survival time
event <- matrix(1, nrow = n, ncol = 1)
time.cens <- rexp(n, rate = 0.5)
ind.time <- (event >= time.cens)
event[ind.time] <- 0
time[ind.time] <- time.cens[ind.time]
## specify the density for the censored covariate:
## For simplicity, we take here the "true" density we simulate from. In an application,
## you might want to use a density with parameters estimated from the censored covariate,
## e.g. using the function ParamSampleCens. See example in Hubeaux & Rufibach (2014).
DensityCens <- function(value){return(dnorm(value, mean = 5, sd = 0.5))}
## use Weibull regression where each censored covariate value is set
## to LOD ("naive" method)
naive <- survreg(Surv(time, event) ~ var1 + var2 + var3.cens[, 2], dist = "weibull")
initial <- as.vector(ConvertWeibull(naive)$vars[, 1])
## use new method that takes into account the left-censoring of one covariate
data <- data.frame(time, event, var3.cens, var1, var2)
formula <- formula(Surv(time, event) ~ Surv(time = var3.cens[, 1], time2 = var3.cens[, 2],
type = "interval2") + var1 + var2)
cens1 <- SurvRegCens(formula = formula, data = data, Density = DensityCens, initial = initial,
namCens = "biomarker")
summary(cens1)
coef(cens1)
logLik(cens1)
## compare estimates
tab <- data.frame(cbind(true, initial, cens1$coeff[, 1]))
colnames(tab) <- c("true", "naive", "Weibull MLE")
rownames(tab) <- rownames(cens1$coeff)
tab
## compare confidence intervals
ConvertWeibull(naive)$HR[, 2:3]
cens1$coeff[, 7:8]
## --------------------------------------------------------------
## model without the non-censored covariates
## --------------------------------------------------------------
naive2 <- survreg(Surv(time, event) ~ var3.cens[, 2], dist = "weibull")
initial2 <- as.vector(ConvertWeibull(naive2)$vars[, 1])
## use new method that takes into account the left-censoring of one covariate
formula <- formula(Surv(time, event) ~ Surv(time = var3.cens[, 1], time2 = var3.cens[, 2],
type = "interval2"))
cens2 <- SurvRegCens(formula = formula, data = data, Density = DensityCens, initial = initial2,
namCens = "biomarker")
summary(cens2)
## compare estimates
tab <- data.frame(cbind(true[c(1, 2, 5)], initial2, cens2$coeff[, 1]))
colnames(tab) <- c("true", "naive", "Weibull MLE")
rownames(tab) <- rownames(cens2$coeff)
tab
## compare confidence intervals
ConvertWeibull(naive2)$HR[, 2:3]
cens2$coeff[, 7:8]
## End(Not run)