Description Usage Arguments Value Note Author(s) References Examples
This function should be used when only a single replication of the error-prone covariate is available. If multiple replications are available please see rc() function. This function estimates the parameters of the semiparametric linear transformation model using regression calibration method when time-to-event is interval-censored and a covariate is measured with error. Estimated standard errors of the model parameters are also provided. A right censoring indicator must be available.
1 | rcw1(datamat, wmat, rfix, gridlen, ntimp, sigma2u)
|
datamat |
A data matrix with as many rows as there are subjects (n) in the study. The first column contains left points of the intervals, second column contains right points of the intervals, third column is the right censoring indicator and the fourth (and final) column is the error-free covariate. |
wmat |
A matrix of surrogate measurements for the covariate with measurement error. |
rfix |
A value that characterizes the error density in the linear transformation model. The value 0 corresponds to the Cox PH model and 1 corresponds to Proportional Odds model. |
gridlen |
A non-negative value representing the desired grid length used to divide the observed failure-time intervals. |
ntimp |
Number of failure time imputations required. |
sigma2u |
A known value for the measurement error variance. |
Parameter estimates of the semiparamteric linear transformation model and their corresponding standard errors.
Larger sample sizes or imputation numbers will result in longer run times.
Soutrik Mandal, Suojin Wang and Samiran Sinha
Mandal, S., Wang, S. and Sinha, S. (2019+). Analysis of Linear Transformation Models with Covariate Measurement Error and Interval Censoring. (accepted, Statistics In Medicine)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | ## this function is used in generating epsilon from its CDF
rsep= function(u,r)
{
if(r==0)
return( log(-log(1-u)) )
else
return( log((exp(-r*log(1-u))-1)/r) )
}
n= 30 #200 # sample size; small number used for quick demonstration only
rfix= 1.0
sigma2u= 0.5
m= 3 #10 # imputed datasets for failure time; small number used for quick demonstration only
nrep= 1 # number of repeated measurement of error prone covariate
gridlen= 0.1
result= NULL
ah=1
set.seed(ah)
# z1= rnorm(n, mean= 0, sd=1)
z1= (rgamma(n,shape=2,scale=2)-4)/sqrt(8)
z2= rbinom(n,1,0.5)
ugen= runif(n)
ep= rsep(ugen,rfix)
truebeta= c(-1,1)
logt= -truebeta[1]*z1 -truebeta[2]*z2 + ep + 3
ttime= exp(logt)
cen= runif(n,0,0.0001)
## creating tau matrix to locate the actual times in each rows and form the corresponding intervals
len= 0.15
taumat= matrix(0,n,10)
taumat[,10]= 9000000000 # if you're changing this, change rcpos below
taumat[,2]= cen
for(i1 in 3:9)
taumat[,i1]= taumat[,2]+(i1-1)*len
## now forming the intervals
right1= rep(0,n)
left= rep(0,n)
for(i2 in 1:n)
{
lenleft= length(which(taumat[i2,2:9]<ttime[i2]))
leftpot= rep(0,8)
leftpot[1:lenleft]= 1
missvec1= c(rbinom(4,1,0.7),rbinom(4,1,0.5))
left[i2]= max(leftpot*missvec1*taumat[i2,2:9])
if(left[i2]==0)
left[i2]= taumat[i2,2]
lenright= length(which(taumat[i2,2:10]>ttime[i2]))
rightpot= rep(0,9)
rightpot[(9-lenright+1):9]= 1
missvec2= c(rbinom(4,1,0.7),rbinom(4,1,0.5),1)
right1temp= rightpot*missvec2*taumat[i2,2:10]
right1[i2]= min(right1temp[right1temp!=0])
}
rcpos= which(right1==9000000000)
lrcpos= length(rcpos)
notrcpos= (1:n)[-rcpos]
delta_temp= rep(1,n) # del=1 are uncensored observations
delta_temp[rcpos]= 0
k= sum(delta_temp) # this is just the number of data points that are not right censored
## measurement error generation
umat= matrix((rgamma(n*nrep,shape=2,scale=2)-4)*0.5/sqrt(8),n,nrep)
wmat= z1+umat
datamat= cbind(left,right1,delta_temp,z2)
ntimp= m
library(icemelt)
out_rcw1= rcw1(datamat, wmat, rfix, gridlen, ntimp, sigma2u)
out_rcw1
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.