## 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])
Run the code above in your browser using DataLab