4
$\begingroup$

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?

$\endgroup$
6
  • $\begingroup$ This QQ-plot strongly suggests you have a heavy-tailed distribution. The "most vanilla" rescaling would be to first try to make your data zero-meaned and having std.deviation of 1; this is not a final solution just a first step. Try it and see if your model behaves better. $\endgroup$
    – usεr11852
    Commented Aug 14, 2014 at 21:40
  • $\begingroup$ Well, I have used scale() to make predictor variable with mean equal 0 and sd equal 0 - qqplot still looks the same, any other ideas for rescalling? $\endgroup$
    – user46703
    Commented Aug 15, 2014 at 10:19
  • $\begingroup$ OK, so something more informed might be helpful. What is variable? Is is reasonable to take the sqrt of it? To log it? To do something like I(variable/1e6) maybe? Try to think easily interpretable transformations before doing something heavy-handed like a Box-Cox. $\endgroup$
    – usεr11852
    Commented Aug 15, 2014 at 21:50
  • $\begingroup$ Box-Cox gave me lambda close to 0 so this mean log transformation, still nothing close to normality in qqplots of residuals $\endgroup$
    – user46703
    Commented Aug 19, 2014 at 20:56
  • $\begingroup$ Try then robust regression methods. In particular the functionality offered by the packages lqmm and robustlmm might can handy... $\endgroup$
    – usεr11852
    Commented Aug 24, 2014 at 4:55

1 Answer 1

1
$\begingroup$

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.

$\endgroup$

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.