[R] model selection with step function

Antonio Olinto aolinto_r at bignet.com.br
Thu Nov 24 22:33:53 CET 2005


Hello,

I have a doubt in using the function step (step wise) to select glm models.

Usually I apply the gamma distribution to analyze fishery data. To select the
terms I use a routine where I first compare single term models to the null model
(eg. U~1 vs. U~depth; U~1 vs. U~latitude; etc. – where U= abundance) and, by
means of the result given by a likelihook function applied for each comparison,
I select the “strongest” effect, let’s say depth. Then I run a new step
comparing the U~depth vs. U~depth+latitude; U~depth vs. U~depth+... etc. Making
this way I put the terms in “magnitude” order.

I tried to make a gaussian model using the step(glm.model) function to select
the terms but I saw that in the output table given by anova(glm.model) the
selected terms kept the original order.

Is it possible to have the terms in the model rearranged, as in my example?

Thanks for any help. I read Chambers and Hastie’s “Statistical Models in S”,
Venables and Ripley “Modern Applied Statistics” and, of course, R help but I
couldn’t get the trick.

Antonio

--
Biologist
Sao Paulo Fisheries Institute



-------------------------------------------------
WebMail Bignet - O seu provedor do litoral
www.bignet.com.br




More information about the R-help mailing list