Skip to content
Prev 994 / 20628 Next

lme nesting/interaction advice

Hi Rolf,
On Tue, May 13, 2008 at 1:59 PM, Rolf Turner <r.turner at auckland.ac.nz> wrote:
< in response to Doug Bates' useful tutorial...>
Hear Hear!

<snip>
Compare:

## R
Linear mixed model fit by REML
Formula: score ~ Machine + (0 + Machine | Worker)
   Data: Machines
   AIC   BIC logLik deviance REMLdev
 228.3 248.2 -104.2    216.6   208.3
Random effects:
 Groups   Name     Variance Std.Dev. Corr
 Worker   MachineA 16.64098 4.07934
          MachineB 74.39558 8.62529  0.803
          MachineC 19.26646 4.38936  0.623 0.771
 Residual           0.92463 0.96158
Number of obs: 54, groups: Worker, 6

## "The-Package"

proc mixed data = machines;
class worker machine;
model score = machine  / solution;
random machine / subject = worker type = un;
run;

 Covariance Parameter Estimates

Cov Parm     Subject    Estimate

UN(1,1)      Worker      16.6405
UN(2,1)      Worker      28.2447
UN(2,2)      Worker      74.3956
UN(3,1)      Worker      11.1465
UN(3,2)      Worker      29.1841
UN(3,3)      Worker      19.2675
Residual                  0.9246


The two outputs report essentially the same thing.
Note that e.g, UN(2,1) = 28.2477 approx= .803*4.07934*8.62529
(And, as usual, the fixed effects estimates match too once the
contrasts and 'types' of SS for an ANOVA table are set up)

UN is short for 'unstructured' - a term Doug has pointed out is not
particularly fitting because the covariance matrix is symmetric
positive definite.
Although this may well not apply to you, another area of confusion
arises not so much from differences between stats packages but by
differences between methods. I'm not an expert in the estimation
methods but, as I understand it, classic texts describe fitting mixed
models in terms of ANOVA in the OLS framework, calculating method of
moments estimators for the variances of the random effects by equating
observed and expected mean squares (I believe using aov and lm with an
'Error' term would fall into this category, and proc anova and proc
glm would also).  Starting in the 90's these methods started falling
out of fashion in favor of ML/REML/GLS methods (likelihood based),
which offer more flexibility in structuring both the error and random
effects covariance matrices, will not produce negative variance
estimates, and have other nice properties that someone more 'mathy'
than me could explain.  Tools like lme, lmer, proc mixed and proc
glimmix fall into this category.

hoping this helps,

Kingsford Jones

Thread (36 messages)

Federico Calboli lme nesting/interaction advice May 11 Andrew Robinson lme nesting/interaction advice May 11 Rolf Turner lme nesting/interaction advice May 11 Andrew Robinson lme nesting/interaction advice May 11 John Maindonald lme nesting/interaction advice May 11 David Duffy lme nesting/interaction advice May 11 Ken Beath lme nesting/interaction advice May 12 Federico Calboli lme nesting/interaction advice May 12 Federico Calboli lme nesting/interaction advice May 12 Federico Calboli lme nesting/interaction advice May 12 Federico Calboli lme nesting/interaction advice May 12 Andrew Robinson lme nesting/interaction advice May 12 Federico Calboli lme nesting/interaction advice May 12 Nick Isaac lme nesting/interaction advice May 12 toby909 at gmail.com lme nesting/interaction advice May 12 Federico Calboli lme nesting/interaction advice May 12 Doran, Harold lme nesting/interaction advice May 12 christian forkstam lme nesting/interaction advice May 12 Federico Calboli lme nesting/interaction advice May 12 Federico Calboli lme nesting/interaction advice May 12 Kevin Wright lme nesting/interaction advice May 12 Douglas Bates lme nesting/interaction advice May 12 Federico Calboli lme nesting/interaction advice May 12 Douglas Bates lme nesting/interaction advice May 12 Rolf Turner lme nesting/interaction advice May 12 Martin Henry H. Stevens lme nesting/interaction advice May 13 Douglas Bates lme nesting/interaction advice May 13 Rolf Turner lme nesting/interaction advice May 13 Kingsford Jones lme nesting/interaction advice May 13 Nathaniel Smith lme nesting/interaction advice May 13 Reinhold Kliegl lme nesting/interaction advice May 14 Nathaniel Smith lme nesting/interaction advice May 14 Kingsford Jones lme nesting/interaction advice May 14 Douglas Bates lme nesting/interaction advice May 14 John Maindonald lme nesting/interaction advice May 14 John Maindonald lme nesting/interaction advice May 15