[R] lme invocation

(Ted Harding) Ted.Harding at nessie.mcc.ac.uk
Tue Dec 17 02:37:03 CET 2002


Doug,
Thanks for these clarifications, especially for pointing out
the chain of defaults (I now see I was a bit out of my depth
when posting my previous mail, so thanks also for the kick-start
in swimming ... ).

See below also.

On 17-Dec-02 Douglas Bates wrote:
> For convenience lme offers several different ways of specifying the
> formula and nesting structure of the random effects.  The default
> random effects have the same model matrix as the fixed effects and the
> default grouping variable.  If the model matrix has more than one
> column the default structure for the variance-covariance of the random
> effects is a general positive-definite symmetric (pdSymm) structure.
> The default parameterization for pdSymm is pdLogChol
> 
> Orthodont is a groupedData object that carries information on the
> grouping structure.  The default grouping variable is Subject.  Hence
> the following specifications should be equivalent after 
>   fixed = distance ~ age, data = Orthodont
> 
>  random = list(Subject = pdLogChol(~ age))
>  random = list(Subject = pdSymm(~ age))
>  random = ~ age | Subject
>  random = ~ age
>  no random specification
> 
> I'm not sure why you got different answers between your first and
> second specifications.  It may be that there is a route through the
> code that picks up a parameterization for pdSymm other than
> pdLogChol.  The default in S-PLUS was pdMatrixLog but we changed that
> in the R implementation because it is difficult (perhaps impossible)
> to get an analytic gradient of the matrix exponential.

Just to show the difference, I have done fm1<-lme(...) with the
first and second specifications I referred to below. For comparison,
results output from the second are interleaved with the first,
and marked by "**" at the start of the line:


  > fm1 <- lme(distance ~ age, data = Orthodont)
**> fm1 <- lme(distance ~ age, data = Orthodont, random=age | Subject)
  > summary(fm1)
**> summary(fm1)
  Linear mixed-effects model fit by REML
**Linear mixed-effects model fit by REML
   Data: Orthodont 
** Data: Orthodont 
         AIC      BIC    logLik
**       AIC      BIC    logLik
    454.6367 470.6173 -221.3183
**  454.6367 470.6173 -221.3183
  
  Random effects:
**Random effects:
   Formula: ~age | Subject
** Formula: ~age | Subject
   Structure: General positive-definite
** Structure: General positive-definite, Log-Cholesky parametrization
              StdDev    Corr  
**            StdDev    Corr  
  (Intercept) 2.3269555 (Intr)
**(Intercept) 2.3271018 (Intr)
  age         0.2264214 -0.609
**age         0.2264283 -0.609
  Residual    1.3100414       
**Residual    1.3100432       
  
  Fixed effects: distance ~ age 
**Fixed effects: distance ~ age 
                  Value Std.Error DF   t-value p-value
**                Value Std.Error DF  t-value p-value
  (Intercept) 16.761111 0.7752380 80 21.620602  <.0001
**(Intercept) 16.761111 0.7752549 80 21.62013  <.0001
  age          0.660185 0.0712526 80  9.265423  <.0001
**age          0.660185 0.0712534 80  9.26531  <.0001
   Correlation: 
** Correlation: 
      (Intr)
**    (Intr)
  age -0.848
**age -0.848
  
  Standardized Within-Group Residuals:
**Standardized Within-Group Residuals:
           Min           Q1          Med           Q3          Max 
**         Min           Q1          Med           Q3          Max 
  -3.223158567 -0.493759795  0.007318547  0.472157317  3.916029639 
**-3.223061787 -0.493755276  0.007315541  0.472145258  3.916026878 
  
  Number of Observations: 108
**Number of Observations: 108

Best wishes,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 167 1972
Date: 17-Dec-02                                       Time: 01:29:49
------------------------------ XFMail ------------------------------




More information about the R-help mailing list