data(pbc)
pbc = pbc[(pbc$time < 3000) & (pbc$time > 800), ]
Z1 = as.matrix(pbc[,5])
Z2 = as.matrix(pbc[,c('albumin')])
colnames(Z1) = c('age')
colnames(Z2) = c('albumin')
del = sign(pbc$status)
tim = pbc$time
res1 = spcox(cva_cons = Z1, cva_time = Z2, delta = del, obstime = tim, bandwidth = 500)
Run the code above in your browser using DataLab