Skip to content

survey package: weights used in svycoxph()

5 messages · Vinh Nguyen, Thomas Lumley

#
Dear R-help,

Let me know if I should email r-devel instead of this list.  This
message is addressed to Professor Lumley or anyone familiar with the
survey package.

Does svycoxph() implement the method outlined in Binder 1992 as
referenced in the help file?  That is, are weights incorporated in the
ratio term (numerator and denominator) of the estimating equation?  I
don't believe so since svycoxph() calls coxph() of the survival
package and weights are applied once in the estimating equation.  If
the weights are implemented in the ratio, could you point me to where
in the code this is done?  I would like to estimate as in Binder but
with custom weights.  Thanks.

This is mentioned in the help file but I don't quite understand:
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.

Vinh
#
Dear R-help,

Let me know if I should email r-devel instead of this list. ?This
message is addressed to Professor Lumley or anyone familiar with the
survey package.

Does svycoxph() implement the method outlined in Binder 1992 as
referenced in the help file? ?That is, are weights incorporated in the
ratio term (numerator and denominator) of the estimating equation? ?I
don't believe so since svycoxph() calls coxph() of the survival
package and weights are applied once in the estimating equation. ?If
the weights are implemented in the ratio, could you point me to where
in the code this is done? ?I would like to estimate as in Binder but
with custom weights. ?Thanks.

This is mentioned in the help file but I don't quite understand:
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.

Vinh
#
On Mon, 17 May 2010, Vinh Nguyen wrote:

            
Yes. That's why it's referenced.
Yes.

  > I
It happens inside the C code called by coxph(), eg, in survival/src/coxfit2.c

Binder's estimating equations are the usual way of applying weights to a Cox model, so nothing special is done apart from calling coxph(). To quote the author of the survival package, Terry Therneau, "Other formulae change in the obvious way, eg, the weighted mean $\bar Z$ is changed to include both the risk weights $r$ and the external weights $w$." [Mayo Clinic Biostatistics technical report #52, section 6.2.2]
The point estimates from coxph() are the same as those from svycoxph() (with the same weights).  The standard errors are almost the same.  There are two differences.  The first is the use of 1/(nclusters -1) rather than 1/nclusters as a divisor.  The second is that svycoxph() computes variances using estimating functions centered at zero in each *sampling* stratum whereas coxph() centers them at zero in each baseline hazard stratum, as supplied in the strata() argument to coxph().

          -thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle
#
On Tue, May 18, 2010 at 8:50 AM, Thomas Lumley <tlumley at u.washington.edu> wrote:
Thank you for your clarification.  I mistakenly assumed weights only
appeared once in the estimating equation, creating a weighted sum of
the score equation.  Thinking in retrospect if the weights are to be
used as case weights they better be in the ratio term as well
(wherever there is an at risk indicator).
Don't see a section 6.2.2 in this technical report.
#
On Tue, 18 May 2010, Vinh Nguyen wrote:

            
Sorry, #58

    -thomas


Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle