search for: sufu2

Displaying 1 result from an estimated 1 matches for "sufu2".

Did you mean: sufu
2004 Apr 06
0
Extracting the survival function estimate from a survreg object.
...))) y <- seq(0, 1, 0.001) # # For a range of p-values, predict the quantiles. # sufu <- list( y=1-y, x=predict.survreg(sure, nd, type="quantile", p=y) ) # # Find the p value for each t, by locating the last quantile no larger than t. # The pairs (t,p) forms a step function. # sufu2 <- list( x=0:14, y=unlist(lapply(0:14,function(x){rev(sufu$y[sufu$x<=x])[1]})) ) # Looks ok? plot(sufu, type="s", xlim=c(0,20)) points(sufu2, pch=20, col="blue") #EOF#