[R] lme confusion

Douglas Bates bates at wisc.edu
Tue Jan 18 15:31:07 CET 2005


Ming Hsu wrote:
> Hi, this is my first time using the nlme package, and I ran into the
> following puzzling problem.
> 
> I estimated a mixed effects model using lme, once using groupedData, once
> explicitly stating the equations.  I had the following outputs.  All the
> coefficients were similar, but they're always slightly different, making me
> think that it's not due to numerical error.
> 
> Also, what is the "Corr" field in the Random Effects output?  Is it the
> correlation between the various regressors?
> 
> Here are the outputs.
> 
> 1. Linear mixed-effects model fit by REML
>  Data: groupedData(dPx ~ EMX + EMY | Session, data = X.cen)
>        AIC     BIC    logLik
>   834.1692 862.532 -407.0846
> 
> Random effects:
>  Formula: ~EMX + EMY | Session
>  Structure: General positive-definite
>             StdDev    Corr
> (Intercept) 1.0205525 (Intr) EMX
> EMX         0.2708627  1
> EMY         0.2795289 -1     -1
> Residual    5.5076376
> 
> Fixed effects: dPx ~ EMX + EMY
>                  Value Std.Error  DF   t-value p-value
> (Intercept)  1.3011219 0.6807083 121  1.911423  0.0583
> EMX          0.7878296 0.2539316 121  3.102526  0.0024
> EMY         -0.1566070 0.1534066 121 -1.020862  0.3094
>  Correlation: 
>     (Intr) EMX   
> EMX  0.151       
> EMY -0.573 -0.092
> 
> Standardized Within-Group Residuals:
>         Min          Q1         Med          Q3         Max
> -3.00618687 -0.23680151 -0.03431868  0.15386198  6.27114243
> 
> Number of Observations: 129
> Number of Groups: 6
> 
> ===============================
> 
> 2. Linear mixed-effects model fit by REML
>  Data: X.cen 
>       AIC      BIC    logLik
>   834.457 862.8199 -407.2285
> 
> Random effects:
>  Formula: ~EMX + EMY | Session
>  Structure: General positive-definite, Log-Cholesky parametrization
>             StdDev    Corr
> (Intercept) 1.0101137 (Intr) EMX
> EMX         0.2108649  0.857
> EMY         0.2995491 -0.944 -0.882
> Residual    5.5104113
> 
> Fixed effects: dPx ~ EMX + EMY
>                  Value Std.Error  DF   t-value p-value
> (Intercept)  1.3062194 0.6823464 121  1.914305  0.0579
> EMX          0.7612238 0.2440504 121  3.119125  0.0023
> EMY         -0.1677985 0.1618076 121 -1.037025  0.3018
>  Correlation: 
>     (Intr) EMX   
> EMX  0.059       
> EMY -0.552 -0.002
> 
> Standardized Within-Group Residuals:
>         Min          Q1         Med          Q3         Max
> -3.00604994 -0.24210830 -0.01660797  0.14846499  6.27931955
> 
> Number of Observations: 129
> Number of Groups: 6

Could you please include the calls to lme so we can see exactly what is 
being fit?

You asked about the Corr columns, those are the correlation form of the 
estimated variance-covariance matrix of the random effects.  Notice that 
you are trying to estmate 6 variance-covariance parameters (3 variances 
and 3 covariances) from information on 6 groups.  In the first output 
the estimated variance-covariance matrix is singlular (correlations of 
-1 and +1).  With so many parameters to estimate from so few groups it 
is not surprising that there is difficulty.




More information about the R-help mailing list