# Summary from lme() output returning estimate value of 0?

I'm trying to run a linear mixed effects model using the nlme package using the lme() function with the txhousing data from the ggplot2 package in R. When I run the following model I get that some of the fixed effects estimates are zero. What can I do to remedy this?

Model Summary Output

I'm specifying the following model using variables from txhousing:  fit1 <- lme(fixed = median ~ date + volume + listings + sales + inventory, random = ~ 1 | city, data = txhousing, method = "ML")

I have not transformed any of the variables.

I've tried running separate lm() fits of lm(median ~ volume, txhousing) and lm(median ~ sales, txhousing) to see what the estimates are and they were not zero in these models.

• That a simpler model has non-zero effects isn't much evidence that a more complex model should have non-zero effects. At the very least, run the same fixed effects terms in lm to see if those terms are close to 0... lm(median ~ date + volume + listings + sales + inventory, data = txhousing) Commented Dec 6, 2023 at 19:44
• "I have not transformed any of the variables." That could also be your problem. If you're not transforming, the coefficients are in the units of your data. If volume and listings are on a drastically different scale than your other variables they might not be easily comparable. Like, if you included house area measured in square cm, that would have a tiny coefficient because a 1 cm^2 increase in house size will have a negligible effect on the price. But if you included area in acres, that would have a huge effect because a 1 acre bigger house would have a massive effect. Commented Dec 6, 2023 at 19:48
• @GregorThomas I ran the lm() model that you specified and it returned estimates for volume of 1.461e-04 with p-value < 2e-16 and estimates for listings of 1.085 with p-value 9.95e-11
– R_studio_user11
Commented Dec 6, 2023 at 19:51
• Yeah, so 0.000461 is pretty much 0, and the 1.085 is also small. If you look directly at fixef(fit1) (can't remember if that's the nlme syntax or just the lme4 syntax...) you may be able to easily see your coefficients with more decimal places. Commented Dec 6, 2023 at 19:53

@GregorThomas's conclusion is exactly correct; this is a scaling problem.

data("txhousing", package = "ggplot2")
library(nlme)

fit1 <- lme(fixed = median ~ date + volume + listings + sales + inventory,
random = ~ 1 | city, data = txhousing, method = "ML",
na.action = na.omit,
## avoid warning from nlminb
control = lmeControl(opt = "optim"))


If you want to see the full range of values, try fixef(fit1):

  (Intercept)          date        volume      listings         sales
-7.582129e+06  3.839669e+03  5.924324e-05 -1.806455e-01 -4.667077e+00
inventory
-3.419350e+02


The intercept is enormous because the mean values of the covariates are far from zero; the other coefficients vary by orders of magnitude because the units/ranges are very different.

We can refit after standardizing (centering and scaling) all the numeric variables (including the response variable, as suggested by Schielzeth (2010)):

nvars <- c("date", "volume", "listings", "sales", "inventory", "median")
txhousing_sc <- txhousing
txhousing_sc[nvars] <- scale(txhousing_sc[nvars])

fit2 <- update(fit1, data = txhousing_sc)
printCoefmat(coef(summary(fit2)))


printCoefmat(coef(summary(fit2)), digits = 3)
Value Std.Error        DF t-value p-value
(Intercept) -1.16e-02  1.06e-01  7.08e+03   -0.11   0.913
date         4.62e-01  4.68e-03  7.08e+03   98.71 < 2e-16 ***
volume       3.88e-01  3.05e-02  7.08e+03   12.75 < 2e-16 ***
listings    -2.89e-02  1.58e-02  7.08e+03   -1.83   0.068 .
sales       -1.39e-01  4.23e-02  7.08e+03   -3.28   0.001 **
inventory   -4.22e-02  8.70e-03  7.08e+03   -4.85 1.3e-06 ***


Schielzeth, Holger. 2010. “Simple Means to Improve the Interpretability of Regression Coefficients: Interpretation of Regression Coefficients.” Methods in Ecology and Evolution 1 (2): 103–13. https://doi.org/10.1111/j.2041-210X.2010.00012.x.

• Thanks so much this makes sense! Thanks to @GregorThomas too! Commented Dec 6, 2023 at 20:19