stdCoxph {stdReg} | R Documentation |
Regression standardization in Cox proportional hazards models
Description
stdCoxph
performs regression standardization in Cox proportional hazards models,
at specified values of the exposure, over the sample covariate distribution.
Let ,
, and
be the survival outcome, the exposure, and a
vector of covariates, respectively.
stdCoxph
uses a fitted Cox
proportional hazards model to estimate the standardized
survival function , where
is a specific value of
,
is a specific value of
, and the expectation is over the marginal
distribution of
.
Usage
stdCoxph(fit, data, X, x, t, clusterid, subsetnew)
Arguments
fit |
an object of class |
data |
a data frame containing the variables in the model. This should be the same
data frame as was used to fit the model in |
X |
a string containing the name of the exposure variable |
x |
an optional vector containing the specific values of |
t |
an optional vector containing the specific values of |
clusterid |
an optional string containing the name of a cluster identification variable when data are clustered. |
subsetnew |
an optional logical statement specifying a subset of observations to be used in the standardization. This set is assumed to be a subset of the subset (if any) that was used to fit the regression model. |
Details
stdCoxph
assumes that a Cox proportional hazards model
has been fitted. Breslow's
estimator of the cumulative baseline hazard
is used together with the partial likelihood estimate of
to obtain
estimates of the survival function
:
For each in the
t
argument and for each in the
x
argument,
these estimates are averaged across all subjects (i.e. all observed values of )
to produce estimates
where is the value of
for subject
,
.
The variance for
is obtained by the sandwich formula.
Value
An object of class "stdCoxph"
is a list containing
call |
the matched call. |
input |
|
est |
a matrix with |
vcov |
a list with |
Note
Standardized survival functions are sometimes referred to as (direct) adjusted survival functions in the literature.
stdCoxph
does not currently handle time-varying exposures or covariates.
stdCoxph
internally loops over all values in the t
argument. Therefore,
the function will usually be considerably faster if length(t)
is small.
The variance calculation performed by stdCoxph
does not condition on
the observed covariates . To see how this matters,
note that
The usual parameter in a Cox proportional hazards model does not
depend on
. Thus,
is independent of
as well (since
), so that the
term
in the corresponding variance
decomposition for
becomes equal to 0. However,
depends on
through the average over the sample
distribution for
, and thus the term
is not 0, unless one conditions on
. The variance calculation by
Gail and Byar (1986) ignores this term, and thus effectively conditions on
.
Author(s)
Arvid Sjolander
References
Chang I.M., Gelman G., Pagano M. (1982). Corrected group prognostic curves and summary statistics. Journal of Chronic Diseases 35, 669-674.
Gail M.H. and Byar D.P. (1986). Variance calculations for direct adjusted survival curves, with applications to testing for no treatment effect. Biometrical Journal 28(5), 587-599.
Makuch R.W. (1982). Adjusted survival curve estimation using covariates. Journal of Chronic Diseases 35, 437-443.
Sjolander A. (2016). Regression standardization with the R-package stdReg. European Journal of Epidemiology 31(6), 563-574.
Sjolander A. (2016). Estimation of causal effect measures with the R-package stdReg. European Journal of Epidemiology 33(9), 847-858.
Examples
require(survival)
n <- 1000
Z <- rnorm(n)
X <- rnorm(n, mean=Z)
T <- rexp(n, rate=exp(X+Z+X*Z)) #survival time
C <- rexp(n, rate=exp(X+Z+X*Z)) #censoring time
U <- pmin(T, C) #time at risk
D <- as.numeric(T < C) #event indicator
dd <- data.frame(Z, X, U, D)
fit <- coxph(formula=Surv(U, D)~X+Z+X*Z, data=dd, method="breslow")
fit.std <- stdCoxph(fit=fit, data=dd, X="X", x=seq(-1,1,0.5), t=1:5)
print(summary(fit.std, t=3))
plot(fit.std)