104
x.mat < — cbind(xxl,xx2)
return(x.mat) }
В.2 Generate tτ and tc as shown in Section 3.4
observ.sim < — function(CDFt,CDFr,beta.org,betac.org) { #1
denomt < — rep(NA,l,m)
denomtc < — rep(NA,l,m)
TT < - rep(NA,l,n)
TC < - rep(NA,l,n)
for (i in l:n) { #2
denomt[i] < — exp((beta.org)% * %V[,i])
denomtc[i] < — exp((betac.org)% * %V[,i])
TT[i] < — sqrt((-2*(log(l-CDFt[i])))∕(denomt[i]))
TC[i] < - (-2*(log(l-CDFr[i])))∕(denomtc[i]) } #2
results < — rbind(TT,TC)
return(results) } #1
B.3 Calculate ⅛θ0∖t) as shown in Equation 3.13
## base line survival function
surv.fnc < — function(obs.ordn,deltaln,delta2n,covv,betaa.f,betac.f){ #10