106
cum.hazdc[j] < — exp(-(cum.hazd[j])) ;
surv.fnc.r[j] < — exp(-(cum.hazdc[j])) } #16
surv.fnc.f < — rbind(surv.fnc.s,surv.fnc.r)
return(surv.fnc.f) } #10
В.4 Calculate P[m∖xj') as shown in Equation 3.15
P.fnc < — function(obs.ordn,deltain,delta2n,cow,rww,rwwc) { #50
# weight,weightc:P:Pc
PP.f < — matrix(NA,n,n)
PPc.f < — matrix(NA,n,n)
for ( i in l:n){ #52
for ( j in l:n) { #53 # time j
if (j >1 ) {#53.1
PP.f[i,j] < - rww[i,(j-l)] - rww[i,j];
PPc.f[i,j] < — rwwc[i,(j-l)] - rwwc[i,j]j} #53.1
if 0 ==1) {
PP.f[i,j] < - 1- rww[i,j];
PPc.f[i,j] < - 1- rwwc[i,j]; } } #53
if (deltain[i] ==1) {PP.f[i,i] < — 1 ; if (i j n) PP.f[i,i+l] = 0}
if (delta2n[i]==l) {PPc.f[i,i] < — 1; if (i j n) PPc.f[i,i+l] = 0} } #52
return(PP.f,PPc.f) } #50