I have three separate glmer models investigating the individual and household-level risk factors of malaria infection in three different spatial locations: 1) outside the forest, 2) at the forest fringe, and 3) inside the forest.

The explanatory variables are a mix of continuous, binary, and categorical variables. The outcome variable is "malaria infected"

I would like a crude comparison of the relative importance of the coefficients across the different spatial locations, i.e. a ranking of the coefficients in each of the locations.

I have been reading "Six Approaches to Calculating Standardised Logistic Regression Coefficients" by Menard (2004). The American Statistician, Vol. 58, No. 3, in which it is clearly stated that for a simple ranking (and comparison) of the coefficients, any of the approaches mentioned in the article is acceptable. (In their examples, the explanatory variables are, like mine, a mix of continuous, binary, and categorical variables). As such, the simplest approach is to multiply the unstandardised coefficient by the standard deviation of the predictor to which the coefficient refers.

However, I do not know how to extract the standard deviation of the coefficients from the glmer output. I am especially confused by the idea of binary or categorical variables having a standard deviation. Can anyone advise?

Secondly, I have read an un-referenced post on an alternative forum that says an acceptable, quick and dirty means of comparison is to sum the Wald chi-squares from the summary output and then take each variable's Wald chi-square and divide this by the sum. From this, one can formulate a crude ranking. Is this an acceptable measure? If so, is there any reference for this?

I would prefer the former method but I need help extracting the standard deviations.

  • 1
    $\begingroup$ I have no answer, sorry, but I'd like to note there are 3 somewhat separate issues here: (1) standardizing coefficients of continuous predictors in logistic regression, which is often done (2) standardizing coefficients of categorical predictors - it's usually considered this does not make much sense, and (3) standardizing coefficients in multilevel regression, which is controversial and not generally recommended. $\endgroup$
    – Sointu
    Jan 4 at 12:01

1 Answer 1


You could get the standard deviations of the predictors via

apply(model.matrix(m), 2, sd)

In the model matrix, categorical variables (factors) have already been converted to contrasts/dummy variables, so the columns of the model matrix are all numeric and it's at least mathematically sensible to compute their standard deviations. However, it is common to not standardize the coefficients of binary and categorical predictors.

For what it's worth, the arm::standardize() function will work for this purpose.

Numeric variables that take on more than two values are each rescaled to have a mean of 0 and a sd of 0.5; Binary variables are rescaled to have a mean of 0 and a difference of 1 between their two categories; Non-numeric variables that take on more than two values are unchanged; Variables that take on only one value are unchanged

It follows Gelman (2008)'s advice to scale by two standard deviations to make coefficients of numeric and binary coefficients more comparable.

Gelman, Andrew. “Scaling Regression Inputs by Dividing by Two Standard Deviations.” Statistics in Medicine 27, no. 15 (July 10, 2008): 2865–73. https://doi.org/10.1002/sim.3107.

  • $\begingroup$ Sorry for my lateness (out of the country and out of contact for over a month) in reading (and accepting) the really helpful answer posted by @Ben Bolker. $\endgroup$ Mar 1 at 0:19

Your Answer

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