6
$\begingroup$

I'm working in R, using glm.nb (of the MASS package) to model count data with a negative binomial regression model. I'd like to compare the relative importance of each of my predictor variables regarding their impact on the response variable (note: the predictors each have quite different scales - sometimes by orders of magnitude). Unfortunately, the output from R gives me results as unstandardized (b) coefficients ("estimates"). I'm hoping someone can give me a hint as to how to go about getting standardized (beta) coefficients from the NB regression model... or another 'better' way to determine the relative importance of each of my predictors on my response variable.

I've investigated several potential ways like:

  1. using the R package 'relimpo' (as suggested in a comment to https://stats.stackexchange.com/a/7118), but it does not work on a NB regression model, thus completely changing the assumptions I should be accounting for and making the outcomes very different;
  2. mean-centering and scaling my data, which changes the interpretation and makes it so that I can't use NB model due to response variables now having negative values;
  3. scaling-only, so that I can still run a NB model... which I thought would only affect the scale of the coefficients without changing their direction (viz., https://stats.stackexchange.com/a/29784 ) - but I do get some positive coefficients that flip to neg. and vice-verse... which seems strange to me and makes me wonder whether I'm making a mistake.

I've benefited from looking at When conducting multiple regression, when should you center your predictor variables & when should you standardize them? (and the suggested links from comments on the question such as http://andrewgelman.com/2009/07/when_to_standar/ and When and how to use standardized explanatory variables in linear regression and Variables are often adjusted (e.g. standardised) before making a model - when is this a good idea, and when is it a bad one?).

Bottom line: I have not yet found a way to use a NB model in R (which I have statistically confirmed is more appropriate than lm, glm, or poisson for modeling my data) and still get at the relative importance - or at least to the standardized beta coefficients - for my predictors...

The R scripts is something like this:

library("MASS")
nb = glm.nb(responseCountVar ~ predictor1 + predictor2 + 
  predictor3, data=myData, control=glm.control(maxit=125))
summary(nb)

scaled_nb = glm.nb(scale(responseCountVar, center = FALSE) ~ scale(predictor1, center = FALSE) + scale(predictor2, center = FALSE) + 
  scale(predictor3, center = FALSE), data=myData, control=glm.control(maxit=125))
summary(scaled_nb)
$\endgroup$
1
  • $\begingroup$ As pointed out by @RobertF (in a comment to one of the answers) the reason why options #2 and #3 were not acting as expected is because I was scaling (and centering as well in #2) BOTH the predictors AND response vars. Only the predictors should be centered & scaled... when I do that, then option #2 gives me exactly what I needed to compare the relative magnitude of effects on the response (which also correspond quite well with the lm.beta(nb) values I discovered later. Now I have more confidence in my results. Thanks for the help! $\endgroup$
    – CJH
    Commented Dec 20, 2012 at 20:44

2 Answers 2

2
$\begingroup$

First you'd have to figure out what change in one variable is "equal" to a what change in another. The usual standardization uses the standard deviation, but that may or may not be ideal. It may not be possible to figure this out - particularly if the IVs are related to each other, in which case a change in one would go with a change in another.

Once you've figured that out, you can get the predicted values from various combinations of the IVs, varying each by the amount you thought was "equal" in the first step.

Another thing to do is to graph the predicted results as the independent variables change in value.

$\endgroup$
3
  • $\begingroup$ Right - this would be called scaling the data, yes? Comparing the unstandardized coefficients would be misleading because my predictor variables are measured on different scales. I had planned to address the issue of comparing coefficients by reassessing the regression results after standardizing by scaling the predictor and the response variables according to their z-scores (a dimensionless quantity derived by subtracting the mean from an individual raw score and then dividing the difference by the standard deviation), see options #2 and #3 that I tried, and problems encountered. $\endgroup$
    – CJH
    Commented Dec 17, 2012 at 20:48
  • $\begingroup$ Just scaling the variables should not change the signt of the parameter estimates. Can you post your data or your code or an minimal example of this happening? $\endgroup$
    – Peter Flom
    Commented Dec 17, 2012 at 23:57
  • $\begingroup$ @CJH I think we can reject Option #2 - standardizing the response variable doesn't make sense, only the predictor variables ought to be standardized. The aim is to reduce multicollinearities between the predictor variables due to scaling, not reduce collinearity between the predictors and response variable. $\endgroup$
    – RobertF
    Commented Dec 20, 2012 at 15:27
0
$\begingroup$

For a quick way to get at the standardized beta coefficients directly from any lm (or glm) model in R, try using lm.beta(model). In the example provided, this would be:

library("MASS")
nb = glm.nb(responseCountVar ~ predictor1 + predictor2 + 
  predictor3, data=myData, control=glm.control(maxit=125))
summary(nb)

library(QuantPsyc)
lm.beta(nb)
$\endgroup$
2
  • $\begingroup$ This tip helps me get closer to my goal of being able to compare the relative importance of my predictors - at least now I have standardized beta coefficients. Still, would be nice to find some package or process like R's 'relimpo' package that will work on a NB model... $\endgroup$
    – CJH
    Commented Dec 20, 2012 at 16:24
  • $\begingroup$ What do you do next to convert these standardized coefficients into measures of relative importance? $\endgroup$
    – Frank H.
    Commented Oct 20, 2015 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.