survey (version 3.9-1)

svykm: Estimate survival function.

Description

Estimates the survival function using a weighted Kaplan-Meier estimator. Standard errors are not currently available.

Usage

svykm(formula, design, ...)
## S3 method for class 'svykm':
plot(x,xlab="time",ylab="Proportion surviving",
  ylim=c(0,1),...)
## S3 method for class 'svykm':
lines(x,xlab="time",type="s",...)
## S3 method for class 'svykmlist':
plot(x, pars=NULL, ...)
## S3 method for class 'svykm':
quantile(x, probs=c(0.75,0.5,0.25),...)

Arguments

formula
Two-sided formula. The response variable should be a right-censored Surv object
design
survey design object
...
in plot and lines methods, graphical parameters
x
a svykm or svykmlist object
xlab,ylab,ylim,type
as for plot
pars
A list of vectors of graphical parameters for the separate curves in a svykmlist object
probs
survival probabilities for computing survival quantiles (note that these are the complement of the usual quantile input

Value

  • For svykm, an object of class svykm for a single curve or svykmlist for multiple curves.

See Also

svycoxph

Examples

Run this code
data(pbc, package="survival")

biasmodel<-glm(I(trt>0)~age*edema,data=pbc)
pbc$randprob<-fitted(biasmodel)

dpbc<-svydesign(id=~1, prob=~randprob, strata=~edema, data=subset(pbc,trt>0))

s1<-svykm(Surv(time,status)~1, design=dpbc)
s2<-svykm(Surv(time,status)~I(bili>6), design=dpbc)

plot(s1)
plot(s2)
plot(s2, lwd=2, pars=list(lty=c(1,2),col=c("purple","forestgreen")))

quantile(s1, probs=c(0.9,0.75,0.5,0.25,0.1))

Run the code above in your browser using DataCamp Workspace