Re: [R] ranking predictive features in logsitic regression

From: David Firth <>
Date: Sat 02 Jul 2005 - 01:36:14 EST

On 30 Jun, 2005, at 21:20, Stephen Choularton wrote:

> Hi
> Is there some function R that multiplies each coefficient by the
> standard deviation of the corresponding variable and produces a
> ranking?

Possibly you meant un-signed coefficients? In which case something like

   function(model) rank(abs(coef(model)) * apply(model.matrix(model), 2, sd))

should do what you asked about.

The "relimp" package provides approximate inference for comparisons of this kind.

I should say that I don't think that such a ranking will often be very useful, though. Some coefficients will be determined with greater precision than others, and there may be correlations to worry about, or variables may only make sense when considered in groups (eg factor effects, or interactions with corresponding main effects, etc.)

David mailing list PLEASE do read the posting guide! Received on Sat Jul 02 01:42:58 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:10 EST