ME_correction: Correction of Measurement Error in Survival time and...

View source: R/measurement_error_correction.R

ME_correctionR Documentation

Correction of Measurement Error in Survival time and Censoring Status.

Description

This function aims to correct for measurement error in survival time and misclassification in censoring status. The key strategy in the function ME_correction includes regression calibration for survival time under additive measurement error models and the unbiased conditional expectation approach for censoring status under misclassification models. With information of parameters in measurement error models implemented, this function will give outputs with corrected survival time and censoring status.

Usage

ME_correction(
  pi_10,
  pi_01,
  gamma0,
  gamma1,
  cor_covar,
  indicator,
  yast,
  covariate
)

Arguments

pi_10

Misclassifcation probability is P(Observed Censoring Status = 1 | Actual Censoring Status = 0).

pi_01

Misclassifcation probability is P(Observed Censoring Status = 0| Actual Censoring Status = 1).

gamma0

A scalar that links the observed survival time and true survival time in the classical additive measurement error model y*=y+gamma0+gamma1*X+v, where y* is observed survival time and y is true survival time, and x is covariates and v is noise term.

gamma1

A p-dimensional vector of parameters in the additive measurement error model y*=y+gamma0+gamma1*X+v, where y* is observed survival time and y is true survival time, x is covariates and v is noise term.

cor_covar

A c(p,p) covariance matrix of a p-dimensional vector of covariates.

indicator

A n-dimensional vector of misclassified censoring status, such as the second column generated by the function gen_data.

yast

A n-dimensional vector of error-prone survival time, such as the first column generated by the function gen_data.

covariate

A c(n,p) matrix of covariates.

Value

correction_data A c(n,2) data frame. This first column is the corrected survival time, and the second column is the corrected censoring indicator.

Examples

## generate data with misclassification = 0.9 with n = 500,
## p = 50 and variance of noise term is 0.75. The y* is related
## to the first covariate.

a <- matrix(0,ncol=50, nrow = 1);a[1,1] <- 1
data <- data_gen(n=500, p=50, pi_01 = 0.9, pi_10 = 0.9,
gamma0=1, gamma1=a, e_var=0.75)

## Assume that covariates are independent and
## observed survival time is related to first covariate with
## weight equals 1. And the scalar in the classical additive
## measurement error model is 1 and is classifcation probability = 0.9.

matrixa <- diag(50)
gamma_0 <-  1 ; gamma_1 <- matrix(0,ncol=50, nrow =1); gamma_1[1,1] <- 1
corrected_data1 <- ME_correction(pi_10=0.9,pi_01=0.9,gamma0 = gamma_0,
gamma1 = gamma_1,
cor_covar=matrixa, y=data[,1],
indicator=data[,2], covariate = data[,3:52])


AFFECT documentation built on July 9, 2023, 6:45 p.m.

Related to ME_correction in AFFECT...