Stephen Choularton
2005-Jun-30 20:20 UTC
[R] ranking predictive features in logsitic regression
Hi Is there some function R that multiplies each coefficient by the standard deviation of the corresponding variable and produces a ranking? Stephen -- No virus found in this outgoing message. Checked by AVG Anti-Virus. [[alternative HTML version deleted]]
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