knitr::opts_chunk$set(prompt = TRUE, comment = "")

In this vignette, we demonstrate how to use the thlm function in censCov package to fit linear regression model with censored covariate using the methods proposed in @qian2018threshold.

Notations

Suppose the linear regression model: $$ Y = \alpha_0 + \alpha_1X + \boldsymbol{\alpha}_2^\top \bf Z + \epsilon, $$ where $Y$ is the response variable, $X$ is the covariate of interest which is subject to right censoring, $\bf Z$ is a $p\times 1$ vector of additional covariates that are completely observed, $\epsilon$ is the random error term with mean 0 and finite variance, and the $\alpha$'s are the corresponding regression coefficients. We assume $epsilon$ is independent of $X$, $\bf Z$, and $C$, where $C$ is the right censoring that potentially censors $X$. The primary scientific interest is in the parameter $\alpha_1$, which captures the association between $Y$ and $X$. The thlm function provides

  1. a test for $H_o: \alpha_1 = 0$ against its complement;
  2. unbiased estimation of the regression coefficient of the censored covariate.

The thlm function

The thlm function presents the threshold regression approaches for linear regression models with a covariate that is subject to random censoring. The threshold regression methods allow for immediate testing of the significance of the effect of a censored covariate. The censCov package can be installed from CRAN with ```{R, eval = FALSE} install.packages("censCov")

or from GitHub with
```{R, eval = FALSE}
devtools::install_github("stc04003/censCov")

The arguments of the thlm function are as follows: ```{R load} library(censCov) args(thlm)

```{R echo = FALSE}
library(survival)

Illustrative (simulated) data

We will illustrate the usage of thlm with a simulated data that is generated as below: ```{R simu} simDat <- function(n) { X <- rexp(n, 3) Z <- runif(n, 1, 6) Y <- 0.5 + 0.5 * X - 0.5 * Z + rnorm(n, 0, .75) cstime <- rexp(n, .75) delta <- (X <= cstime) * 1 X <- pmin(X, cstime) data.frame(Y = Y, X = X, Z = Z, delta = delta) } set.seed(1) head(dat <- simDat(200), 10)

The columns in the simulated data set, `dat`, are

  - `Y` is the response variable
  - `X` is the covariate of interest when `delta = 1` or the right censored value when `delta = 0`
  - `Z` is an additional covariate that is completely observed
  - `delta` is the censoring indicator for `X`

The average censoring percentage is about 20\%.

## Methods
The following methods for censored covariates are implemented in `thlm`.

### Complete cases
When `method = "cc"`, `thlm` removes rows with `delta = 0` and 
fits the linear model via `lm`.
```{R}
thlm(Y ~ Surv(X, delta) + Z, data = dat, method = "cc")

or

thlm(Y ~ X + Z, data = dat, subset = delta == 1)

The two $p$-values differs a bit because the thlm returns the Wald $p$-value.

Reverse survival regression

summary(thlm(Y ~ Surv(X, delta) + Z, data = dat, method = "rev"))

Deletion threshold regression

summary(thlm(Y ~ Surv(X, delta) + Z, data = dat, method = "del", B = 100))

Complete threshold regression

summary(thlm(Y ~ Surv(X, delta) + Z, data = dat, method = "com", B = 100))

All

The thlm function allows method = "all" that runs the complete cases analysis, reverse survival regression, deletion threshold regression, and complete threshold regression at once.

summary(thlm(Y ~ Surv(X, delta) + Z, data = dat, method = "all", B = 100, 
             control = list(t0.plot = FALSE)))

FAQ

Can thlm fit model with one censored covariate ($X$) without any fully observed covaraite ($Z$)?

Yes. For example:

summary(thlm(Y ~ Surv(X, delta), data = dat, method = "all", B = 100, 
             control = list(t0.plot = FALSE)))

Can thlm fit model with one censored covariate ($X$) and multiple fully observed covaraites ($Z$)?

Yes. For example:

dat$Z2 <- dat$Z^2
summary(thlm(Y ~ Surv(X, delta) + Z + Z2, data = dat, method = "all", B = 100, 
             control = list(t0.plot = FALSE)))

Does the censored covariate ($X$) need to be specified first in the formula?

Not nesscary. For exmaple:

dat$Z2 <- dat$Z^2
summary(thlm(Y ~ Z + Surv(X, delta) + Z2, data = dat, method = "all", B = 100, 
             control = list(t0.plot = FALSE)))

Can thlm fit model with more than one censored covariate ($X$)?

No.

Reference



stc04003/censCov documentation built on June 5, 2019, 11:08 p.m.