Cox Regression with Dependent Error in Covariates

Package coxerr performs the functional modeling methods of Huang and Wang (2018) to accommodate dependent error in covariates of the proportional hazards model. The adopted measurement error model has minimal assumptions on the dependence structure, and an instrumental variable is supposed to be available.

Installation

coxerr is available on CRAN:

install.packages("coxerr")

Cox regression with dependent error in covariates

Simulate a dataset for the purpose of illustration, following Scenario 1 of Table 1 in Huang and Wang (2018):

size <- 300
bt0 <- 1
## true covariate
x <- rnorm(size)
## survival time, censoring time, follow-up time, censoring indicator
s <- rexp(size) * exp(-bt0 * x)
c <- runif(size) * ifelse(x <= 0, 4.3, 8.6)
t <- pmin(s, c)
dlt <- as.numeric(s <= c)
## mismeasured covariate with heterogeneous error, IV
w <- x + rnorm(size) * sqrt(pnorm(x) * 2) * 0.5 + 1
u <- x * 0.8 + rnorm(size) * 0.6
wuz <- cbind(w, u)

Run the two proposed methods:

library(coxerr)
## estimation using PROP1
fit1 <- coxerr(t, dlt, wuz, 1)
fit1
#> $bt
#> [1] 1.158378
#> 
#> $va
#>            [,1]
#> [1,] 0.02392495
#> 
#> $succ
#> [1] TRUE
## estimation using PROP2
fit2 <- coxerr(t, dlt, wuz, 2)
fit2
#> $bt
#> [1] 1.279255
#> 
#> $va
#>            [,1]
#> [1,] 0.04354335
#> 
#> $succ
#> [1] TRUE

References

Huang, Y. and Wang, C. Y. (2018) Cox Regression with dependent error in covariates, Biometrics 74, 118–126.