surv.fit(time, status, strata=rep(1, length(time)), na.strata=F, type= "kaplan-meier", error="greenwood", conf.level=.95, conf.type= "log", wt=rep(1, length(time)), coxreg.list, x, predict.at= <<see below>>)
The Greenwood formula for the variance is a sum of terms d/(n*(n-m)), where d is the number of deaths at a given time point, n is the sum of wt for all individuals still at risk at that time, and m is the sum of weights for the deaths at that time. The justification is based on a binomial argument when weights are all equal to one; extension to the weighted case is ad hoc.
Link, C. L. (1984). Confidence intervals for the survival function using Cox's proportional hazards model with covariates. Biometrics 40, 601-610.
Tsiatis, A. (1981). A large sample study of the estimate for the integrated hazard function in Cox's regression model for survival data. Annals of Statistics 9, 93-108.
fit <- surv.fit(cancer$time, cancer$status, type="fleming") print(fit) # printout in matrix form of results. plot(fit) # plot of the survival function(s) # including 95% C.I.