[R] A question about stepwise procedures: step function

From: Li, Jia <LI_at_nsabp.pitt.edu>
Date: Thu 15 Jun 2006 - 04:14:26 EST


Dear all,

I tried to use "step" function to do model selection, but I got an error massage. What I don't understand is that data as data.frame worked well for my other programs, how come I cannot make it run this time. Could you please tell me how I can fix it?


>all<-data.frame(z1,z2,z3)

>fit.model.all<- coxph(Surv(t,cen) ~z1+z2+z3,data=all)

> reg.model.all<-step(fit.model.all)

Start: AIC= 689.1
 Surv(t, cen) ~ z1 + z2 + z3
Error in as.data.frame.default(data) : cannot coerce class "function" into a data.frame



Thanks a lot!  

Jia



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jun 15 04:19:17 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 15 Jun 2006 - 06:11:32 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.