s-news
[Top] [All Lists]

Re: Cox + bootstrap

To: "Heymans, MW" <mw.heymans@vumc.nl>
Subject: Re: Cox + bootstrap
From: Frank E Harrell Jr <f.harrell@vanderbilt.edu>
Date: Sun, 07 May 2006 06:55:36 -0500
Cc: s-news <s-news@lists.biostat.wustl.edu>
In-reply-to: <B8CF0F16EE1E1B42854D9ACCEB606864273FFB@vumc-mb01.vumc.nl>
References: <B8CF0F16EE1E1B42854D9ACCEB606864273FFB@vumc-mb01.vumc.nl>
User-agent: Debian Thunderbird 1.0.7 (X11/20051017)
Heymans, MW wrote:

Hi all,
Help is appreciated on this one. I wrote some simple lines to apply the bootstrap and Cox regression (used Canty's and Harrells functions).
bw.fun <- function(data, i){

   d <- data[, i]

   t <- d$dag2

   e <- d$st2

   dd <- datadist(d = d)

   options(datadist = 'dd')

   Srv <- Surv(t,e)

   fit.bw <- cph(form.m, data = d, surv=TRUE, time.inc = 180, x = T, y = T)

   fb <- fastbw(fit.bw)

   list(coef(fb))

}

Martijn,

You are putting things inside the bootstrap loop that should be outside. Also you are not taking advantage of the validate function in Design that will do bootstrapping with bw=TRUE to use fastbw and will summarize the volatility in selection of variables.

validate, calibrate, and bootcov in Design use lower-level functions for fitting the resamples, which will also speed up the execution a good deal.

Frank



bw.boot <- boot(data = set, statistic = bw.fun, R = 5)

However, the regr. coeffiecients are not stored in bw.boot$t and I do not know why? (it is the same with other fastbw values (like names.kept, factors.kept). It is strange because If I do fastbw on the original sample about 5 factors are kept in the model. Can somebody help me with the solution? Thank! Martijn PS. I also tried other selection levels for the variables, but no difference (i.e. no selections).


--
Frank E Harrell Jr   Professor and Chair           School of Medicine
                     Department of Biostatistics   Vanderbilt University

<Prev in Thread] Current Thread [Next in Thread>