martinctc / rwa

Package for running Relative Weights Analysis in R
https://martinctc.github.io/rwa
12 stars 8 forks source link

variable scaling? #15

Closed kalimiddleby closed 9 months ago

kalimiddleby commented 2 years ago

Hi Martin,

Just wondering if I am supposed to scale the predictor variables prior to running the rwa() function? Is this done automatically or am I misinterpretting how this approach works?

Thanks!

martinctc commented 2 years ago

Hi @kalimiddleby - the function computes a correlation matrix prior as part of the relative weights analysis. In that sense, scaling might not be required. Could you explain what you would envisage the scaling is required for, or the type of data that you are working with?

Note that 'rescaling' is also done on the final output by making sure that the weights add up to 100% to broadly estimate the 'proportion of contribution to importance'. import is the rescaled weights here:

  RawWgt <- lambdasq %*% beta ^ 2 # Raw Relative Weight
  import <- (RawWgt / rsquare) * 100 # Rescaled Relative Weight