8
$\begingroup$

I have created two mixed regression models, one with raw unstandardized variables and the same model with standardized variables. When I convert the coefficients from the standardized variables I get different coefficients, especially for the intercept.

Raw Unstandardized Variables

The model I use for the raw unstandardized variables is:

    model <- lmer(MatchScore~ElapsedTime+UsableIrisArea+DilationChange+Sharpness+
             (1|SubjectID)+(0+DilationChange|SubjectID)+(0+UsableIrisArea|SubjectID)+(0+ElapsedTime|SubjectID),
           data=Data, na.action="na.fail", REML=FALSE)
    summary(model)

I get the following results:

         AIC      BIC   logLik deviance df.resid 
         124741.4 124814.4 -62360.7 124721.4    10969 

         Scaled residuals: 
         Min      1Q  Median      3Q     Max 
         -8.1739 -0.5233  0.0491  0.5811  4.0564 

         Random effects:
         Groups      Name           Variance  Std.Dev.
         SubjectID   (Intercept)    16484.064 128.390 
         SubjectID.1 DilationChange     4.872   2.207 
         SubjectID.2 UsableIrisArea     2.510   1.584 
         SubjectID.3 ElapsedTime        6.593   2.568 
         Residual                    4726.140  68.747 
         Number of obs: 10979, groups:  SubjectID, 73

         Fixed effects:
         Estimate Std. Error         df t value Pr(>|t|)    
         (Intercept)     -162.3829    19.1380    45.9334  -8.485 5.83e-11 ***
         ElapsedTime       -5.3536     0.4616    35.6739 -11.597 1.17e-13 ***
         UsableIrisArea     6.4372     0.2381    46.6754  27.040  < 2e-16 ***
         DilationChange    -5.3044     0.3542    42.9306 -14.974  < 2e-16 ***
         Sharpness          4.8622     0.1516 10793.8131  32.063  < 2e-16 ***
         ---
         Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

         Correlation of Fixed Effects:
         (Intr) ElpsdT UsblIA DltnCh
         ElapsedTime -0.038                     
         UsableIrsAr -0.383  0.019              
         DilatinChng -0.008 -0.090 -0.018       
         Sharpness   -0.037  0.041 -0.008  0.000

Standardized Variables

The model I use for the standardized variables is:

    model2 <- lmer(MatchScore~ElapsedTime+UsableIrisArea+DilationChange+Sharpness+
             (1|SubjectID)+(0+DilationChange|SubjectID)+(0+UsableIrisArea|SubjectID)+(0+ElapsedTime|SubjectID),
           data=Data.Scaled, na.action="na.fail", REML=FALSE)

    summary(model2)

I get the following results:

    AIC      BIC   logLik deviance df.resid 
    20216.8  20289.9 -10098.4  20196.8    10969 

    Scaled residuals: 
    Min      1Q  Median      3Q     Max 
   -8.1032 -0.5237  0.0489  0.5767  4.0852 

    Random effects:
    Groups      Name           Variance Std.Dev.
    SubjectID   (Intercept)    0.280539 0.52966 
    SubjectID.1 DilationChange 0.010866 0.10424 
    SubjectID.2 UsableIrisArea 0.061813 0.24862 
    SubjectID.3 ElapsedTime    0.008361 0.09144 
    Residual                   0.348526 0.59036 
    Number of obs: 10979, groups:  SubjectID, 73

    Fixed effects:
    Estimate Std. Error         df t value Pr(>|t|)    
    (Intercept)    -9.730e-02  6.478e-02  7.107e+01  -1.502    0.138    
    ElapsedTime    -1.893e-01  1.638e-02  3.960e+01 -11.562  2.9e-14 ***
    UsableIrisArea  5.306e-01  3.380e-02  4.388e+01  15.698  < 2e-16 ***
    DilationChange -2.558e-01  1.678e-02  4.439e+01 -15.248  < 2e-16 ***
    Sharpness       3.042e-01  9.508e-03  1.079e+04  31.992  < 2e-16 ***
    ---
    Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

    Correlation of Fixed Effects:
    (Intr) ElpsdT UsblIA DltnCh
    ElapsedTime  0.083                     
    UsableIrsAr -0.061  0.022              
    DilatinChng  0.023 -0.093 -0.007       
    Sharpness    0.017  0.040 -0.003 -0.001

Then I convert the standardized coefficients using the logic in this post https://stackoverflow.com/a/23643740/2343633

The standardized coefficients are:

       (Intercept)    ElapsedTime UsableIrisArea DilationChange      Sharpness 
       494.651361      -5.324217       8.430474      -3.339946       6.32240

This where it gets interesting - when converting the standardized coefficients the intercept actually makes sense, the match score should never fall below 0. Where as, the intercept from model with the unstandardized coefficients is negative - which makes absolutely no sense. Additionally, as you can see some the coefficients change for the transformed standardized coefficients, more specifically, Sharpness, UsableIrisArea, and DilationChange.

I would like to note that this data is very noisy and not all subjects have the same number of samples nor the same amount of time between samples. This is something that I can not change. Put simply, the data is what it is. My questions are:

  1. Why would I get varying results with standardized and raw unstandardized variables. Is this a major issue?

  2. Given the second model (the one with the standardized variables) makes more sense should this be the model I use?

  3. Is there a more scientific way in determining if standardized or unstandardized variables is more appropriate for my model.

Any other suggestions, comments, or recommendations would be appreciated. If you need any additional information I more than happy to supply that.

$\endgroup$
3
  • 3
    $\begingroup$ Guessing this happens because you're fitting random slopes as independent terms ((1|Subject) + (0+x|Subject) + (0+y|Subject)) ...thus the results are no longer invariant to linear transformations of the variables ... the tipoff that you're fitting a different model is that the log-likelihood/AIC/BIC change between models (they shouldn't if all you're doing is re-parameterizing to an equivalent model). Do you get identical answers for both data sets if your RE term is (1+x+y+z|Subject) (where x, y, z are your predictors)? ... Identical if you only scale rather than scale+center? $\endgroup$ – Ben Bolker Jun 15 '18 at 22:06
  • 2
    $\begingroup$ see "Specifying uncorrelated random effects" in vignette("lmer",package="lme4") for a bit more info ... $\endgroup$ – Ben Bolker Jun 15 '18 at 22:07
  • $\begingroup$ @BenBolker you are correct. I want my random effects to be uncorrelated so that means by standardizing the variables I am also changing my model. That explains the differences because they are indeed two separate models. Thank you! $\endgroup$ – thutchi Jun 15 '18 at 23:28
3
$\begingroup$

As pointed out by @BenBolker uncorrelated random slopes are independent terms. Because the random effects are uncorrelated an additive transformation does and will result in a change in estimated correlations as well as the likelihood and predictions of the resulting model (Bates, Mächler, Bolker, & Walker, 2015).

Edit: Updated to reflect @BenBolker's comment - an additive transformation will cause the problems not a linear one.

Bates, D., Mächler, M., Bolker, B., & Walker, S. (2015). Fitting Linear Mixed-Effects Models Using lme4. Journal of Statistical Software, 67(1), 1 - 48. doi:http://dx.doi.org/10.18637/jss.v067.i01

$\endgroup$
2
  • 1
    $\begingroup$ I think to be precise it's not actually any linear transformation, but rather additive shifts only; that is, $x \to bx$ would be OK, but not $x \to a + bx, a \neq 0$. (You could try an experiment.) $\endgroup$ – Ben Bolker Jun 15 '18 at 23:47
  • $\begingroup$ @BenBolker Thank you so much for your help! I guess I should pay more attention to the names in the literature I read. You and lme4 have been a great help in writing my thesis and I appreciate your clarifications and guidance. As suggested, I did some experimentation and now I have a better understanding of the issue. $\endgroup$ – thutchi Jun 16 '18 at 2:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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