Skip to content
Prev 105580 / 398506 Next

using R for survival analysis

On Tue, 5 Dec 2006, Michael McCulloch wrote:

            
You can do IPW estimation with the coxph() function in the 'survival' 
package as long as you use the `robust=TRUE' option for standard errors.

The weights can be supplied as weights to coxph().

  You need to fit logistic regression models for treatment, with glm(), 
then use predict() to get probabilities of treatment (yes/no) then convert 
these into probability of observed treatment, then take the reciprocal to 
get the weights.

How messy this all is depends on the data structure -- how regular the 
observations of 'treatment' are, for example -- since this determines how 
many different logistic models for treatment you will need.

 	-thomas

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