<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi, all:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>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. </FONT></DIV>
<DIV><FONT face=Arial size=2>
<P class=MsoPlainText><SPAN
style="mso-fareast-font-family: 'MS Mincho'">dat3.pred.fun <- function( data,
i, formula )<?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoPlainText><SPAN style="mso-fareast-font-family: 'MS Mincho'">{ d
<- data[i,]<o:p></o:p></SPAN></P>
<P class=MsoPlainText><SPAN style="mso-fareast-font-family: 'MS Mincho'"><SPAN
style="mso-spacerun: yes"> </SPAN>d.glm.all <-
glm(formula,family=binomial,data=d )<o:p></o:p></SPAN></P>
<P class=MsoPlainText><SPAN style="mso-fareast-font-family: 'MS Mincho'"><SPAN
style="mso-spacerun: yes">
</SPAN>d.fit<-step(d.glm.all)<o:p></o:p></SPAN></P>
<P class=MsoPlainText> formula(d.fit) </P>
<P class=MsoPlainText># or summary(d.fit)$coefficient[,1]</P>
<P class=MsoPlainText># .....</P>
<P class=MsoPlainText>}</P>
<P class=MsoPlainText> And then I called the boot function as: </P>
<P class=MsoPlainText><SPAN
style="mso-fareast-font-family: 'MS Mincho'">r_300<SPAN
style="mso-spacerun: yes"> </SPAN># no of bootstrap
samples<o:p></o:p></SPAN></P>
<P class=MsoPlainText><SPAN
style="mso-fareast-font-family: 'MS Mincho'">dat3.boot <- boot( dat3,
dat3.pred.fun, R=r,sim="ordinary", formula=formula(dat3.glm.help))</SPAN></P>
<P class=MsoPlainText><SPAN
style="mso-fareast-font-family: 'MS Mincho'">However, R gave me message like "
terms. formula(X, ...): object "d" not found". Anyone has any clue about it?
</SPAN></P>
<P class=MsoPlainText><SPAN style="mso-fareast-font-family: 'MS Mincho'">Thank
you very much for your time!</SPAN></P>
<P class=MsoPlainText>Sincerely,</P>
<P class=MsoPlainText>Yunda</P>
<P class=MsoPlainText>Department of Biostatistics </P>
<P class=MsoPlainText>University of California, Los Angeles</P>
<P class=MsoPlainText> </P>
<P class=MsoNormal> </P></FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV></BODY></HTML>