108
rw.f[i,j] < - 0;
if (gg[i,j] <1){ #38
rwc.f[i,j] < — (l-cx(ff[i,i],gg[i,j],alphaa))∕(l-cx(ff[i,i],gg[i,i],alphaa));
} else {rwc.f[i,j] < — 0} }#37
if (delta2n[i]==l){ #40
rwc.f[i,j] < — 0;
if (ff[i,j] < 1) { #41
rw.f[i,j] < - (l-cy(ff[i,j],gg[i,i],alphaa))∕(l-cy(ff[i,i],gg[i,i],alphaa));
} else {rw.f[i,j] < — 0} }#40
if (deltain[i]!=l && delta2n[i]!=l){ #43
rw.f[i,j] < - 0;
rwc.f[i,j] < - 0; } } }}#33,34
return(rw.f,rwc.f) } #30
B.5 Calculate as shown in Equation 3.19
surv.fnc.n < — function(obs.ordn,deltaln,delta2n,covv,betaa.f,
betac.f,rww,rwwc,PP,PPc) {#10
cum.hazd < — matrix(NA,l,n);
cum.hazdc < — matrix(NA,l,n);
item < — matrix(NA,l,n)
itemc < — matrix(NA,l,n)