Description Usage Arguments Details Value Warning Author(s) References See Also Examples
Fit a proportional hazards model to data from a complex survey design.
1 2 3 4 5 6 
formula 
Model formula. Any 
design 

subset 
Expression to select a subpopulation 
rescale 
Rescale weights to improve numerical stability 
object 
A 
newdata 
New data for prediction 
se 
Compute standard errors? This takes a lot of memory for

type 
"curve" does predicted survival curves. The other values
are passed to 
... 
For 
k 
The penalty per parameter that would be used under independent sampling: AIC has 
The main difference between svycoxph
function and the robust=TRUE
option to coxph
in the
survival package is that this function accounts for the reduction in
variance from stratified sampling and the increase in variance from
having only a small number of clusters.
Note that strata
terms in the model formula describe subsets that
have a separate baseline hazard function and need not have anything to
do with the stratification of the sampling.
The AIC
method uses the same approach as AIC.svyglm
,
though the relevance of the criterion this optimises is a bit less clear
than for generalised linear models.
The standard errors for predicted survival curves are available only by linearization, not
by replicate weights (at the moment). Use
withReplicates
to get standard errors with replicate
weights. Predicted survival curves are not available for stratified
Cox models.
The standard errors use the deltamethod approach of Williams (1995)
for the NelsonAalen estimator, modified to handle the Cox model
following Tsiatis (1981). The standard errors agree closely with
survfit.coxph
for independent sampling when the model fits
well, but are larger when the model fits poorly. I believe the
standard errors are equivalent to those of Lin (2000), but I don't
know of any implementation that would allow a check.
An object of class svycoxph
for svycoxph
, an object of
class svykm
or svykmlist
for predict(,type="curve")
.
The standard error calculation for survival curves uses memory proportional to the sample size times the square of the number of events.
Thomas Lumley
Binder DA. (1992) Fitting Cox's proportional hazards models from survey data. Biometrika 79: 139147
Lin DY (2000) On fitting Cox's proportional hazards model to survey data. Biometrika 87: 3747
Tsiatis AA (1981) A Large Sample Study of Cox's Regression Model. Annals of Statistics 9(1) 93108
Williams RL (1995) "ProductLimit Survival Functions with Correlated Survival Times" Lifetime Data Analysis 1: 171–186
svykm
for estimation of KaplanMeier survival curves and
for methods that operate on survival curves.
regTermTest
for Wald and (RaoScott) likelihood ratio tests for one or more parameters.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  ## Somewhat unrealistic example of nonresponse bias.
data(pbc, package="survival")
pbc$randomized<with(pbc, !is.na(trt) & trt>0)
biasmodel<glm(randomized~age*edema,data=pbc,family=binomial)
pbc$randprob<fitted(biasmodel)
if (is.null(pbc$albumin)) pbc$albumin<pbc$alb ##pre2.9.0
dpbc<svydesign(id=~1, prob=~randprob, strata=~edema, data=subset(pbc,randomized))
rpbc<as.svrepdesign(dpbc)
(model<svycoxph(Surv(time,status>0)~log(bili)+protime+albumin,design=dpbc))
svycoxph(Surv(time,status>0)~log(bili)+protime+albumin,design=rpbc)
s<predict(model,se=TRUE, type="curve",
newdata=data.frame(bili=c(3,9), protime=c(10,10), albumin=c(3.5,3.5)))
plot(s[[1]],ci=TRUE,col="sienna")
lines(s[[2]], ci=TRUE,col="royalblue")
quantile(s[[1]], ci=TRUE)
confint(s[[2]], parm=365*(1:5))

Loading required package: grid
Loading required package: Matrix
Loading required package: survival
Attaching package: 'survey'
The following object is masked from 'package:graphics':
dotchart
Call:
svycoxph(formula = Surv(time, status > 0) ~ log(bili) + protime +
albumin, design = dpbc)
coef exp(coef) se(coef) z p
log(bili) 0.8859 2.4252 0.0905 9.79 < 2e16
protime 0.2449 1.2775 0.0812 3.01 0.0026
albumin 1.0430 0.3524 0.2045 5.10 3.4e07
Likelihood ratio test= on 3 df, p=
n= 312, number of events= 144
Call:
svycoxph.svyrep.design(formula = Surv(time, status > 0) ~ log(bili) +
protime + albumin, design = rpbc)
coef exp(coef) se(coef) z p
log(bili) 0.8859 2.4252 0.0984 9.01 < 2e16
protime 0.2449 1.2775 0.0937 2.61 0.009
albumin 1.0430 0.3524 0.2197 4.75 2.1e06
Likelihood ratio test=NA on 3 df, p=NA
n= 312, number of events= 144
0.75 0.5 0.25
1435 2503 3574
attr(,"ci")
0.025 0.975
0.75 1217 1786
0.5 2256 3170
0.25 3222 Inf
0.025 0.975
365 0.8375139 0.9453781
730 0.7382750 0.8999016
1095 0.4784105 0.7478460
1460 0.3192009 0.6206764
1825 0.2149475 0.5292978
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.