Hi, all: Is there anyone know about the variable selection procedure in R using bootstrapping? I tried to define the statistics function as following to find the best set of covariates in each bootstrap resample. My plan was to construct the final model based on the common covariates picked from every R=300 resamples. dat3.pred.fun <- function( data, i, formula ) { d <- data[i,] d.glm.all <- glm(formula,family=binomial,data=d ) d.fit<-step(d.glm.all) formula(d.fit) # or summary(d.fit)$coefficient[,1] # ..... } And then I called the boot function as: r_300 # no of bootstrap samples dat3.boot <- boot( dat3, dat3.pred.fun, R=r,sim="ordinary", formula=formula(dat3.glm.help)) However, R gave me message like " terms. formula(X, ...): object "d" not found". Anyone has any clue about it? Thank you very much for your time! Sincerely, Yunda Department of Biostatistics University of California, Los Angeles -------------- next part -------------- An HTML attachment was scrubbed... URL: https://stat.ethz.ch/pipermail/r-help/attachments/20010820/8be2d322/attachment.html
fharrell@virginia.edu
2001-Aug-21 00:15 UTC
[R] variable selection in R using bootstrapping
Please use ordinary text e-mail. Bootstrapping has no advantage for selecting variables, only for studying the ill effects of such selection. The major problem with using the bootstrap the way you have outlined is that the selection frequency is ruined by collinearity, i.e., collinearity makes the selection of one variable over another about as reliable as flipping a coin. Besides, the selection frequency is highly related to the P-value from the initial model, if you were using backwards stepdown. So the bootstrap does not offer much new information anyway. -Frank -- Frank E Harrell Jr Prof. of Biostatistics & Statistics Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences U. Virginia School of Medicine http://hesweb1.med.virginia.edu/biostat -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._