Displaying 1 result from an estimated 1 matches for "sufu".
Did you mean:
sfu
2004 Apr 06
0
Extracting the survival function estimate from a survreg object.
...ge + group + sex, data = modb)
nd <- data.frame(
age=50,
group=factor("A", levels=c("A", "B", "C")),
sex=factor("M", levels=c("F", "M")))
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])[...