I just fitted the following linear mixed effects model:
Linear mixed model fit by maximum likelihood ['lmerMod']
Formula: price ~ variable + (1 | product)
Data: podzbior
AIC BIC logLik deviance df.resid
130840.14 130868.85 -65416.07 130832.14 9674
Scaled residuals:
Min 1Q Median 3Q Max
-6.2824 -0.3099 -0.0547 0.2201 12.4291
Random effects:
Groups Name Variance Std.Dev.
product (Intercept) 427375 653.7
Residual 25930 161.0
Number of obs: 9678, groups: product, 1222
Fixed effects:
Estimate Std. Error t value
(Intercept) 9.362e+02 1.899e+01 49.29
variable -7.521e-04 1.171e-04 -6.42
Correlation of Fixed Effects:
(Intr)
variable -0.050
That was output from summary(lmerModel)
, after the run of lmer
I got this warning:
Warning:
In checkScaleX(X, ctrl = control) :
Some predictor variables are on very different scales: consider rescaling
Q1 Predictor variable is numeric from 0 to something like 100k, how It should be scaled?
Random effects with confidence intervals chart for this model looks like this, is it OK?:
I am pretty sure residuals are not OK. What should I do in this case?
How can I go deeper with this model diagnostic, besides checking p-values?
Best Answer
Your QQ-plot shows heavy tails which suggests that your data/observations are not coming from a normal distribution. While rescaling might still be relevant here, what you really need to do is to first try and transform your dependent variables "price" (e.g., to log(price)) to make your observations closer to normal. Otherwise, you cannot trust your model fit and errors.
You might want to look at the BoxCox transformations to understand which transformation is appropriate for your data.
Otherwise you might want to consider non-linear mixed models that better fit your model.