survey package: weights used in svycoxph()

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

survey package: weights used in svycoxph()

Vinh Nguyen-3
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

survey package: weights used in svycoxph()

Vinh Nguyen-3
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: survey package: weights used in svycoxph()

Thomas Lumley
In reply to this post by Vinh Nguyen-3
On Mon, 17 May 2010, Vinh Nguyen wrote:

> 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?

Yes. That's why it's referenced.

>That is, are weights incorporated in the
> ratio term (numerator and denominator) of the estimating equation?

Yes.

  > 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.

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]


> 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.

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
[hidden email] University of Washington, Seattle

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: survey package: weights used in svycoxph()

Vinh Nguyen-3
On Tue, May 18, 2010 at 8:50 AM, Thomas Lumley <[hidden email]> wrote:

>
>  > 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.
>
> It happens inside the C code called by coxph(), eg, in
> survival/src/coxfit2.c
>

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).

> 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]

Don't see a section 6.2.2 in this technical report.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: survey package: weights used in svycoxph()

Thomas Lumley
On Tue, 18 May 2010, Vinh Nguyen wrote:

>> 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]
>
> Don't see a section 6.2.2 in this technical report.

Sorry, #58

    -thomas


Thomas Lumley Assoc. Professor, Biostatistics
[hidden email] University of Washington, Seattle

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.