Skip to content
Prev 7409 / 20628 Next

Trouble Replicating Unstructured Mixed Procedure in R

I've twigged that "unstructured" means a variance-covariance matrix 
that ignores the time structure, i.e., each element is estimated 
separately.  One can do this in lme4, thus:

Orthodont$Age <- factor(Orthodont$age)
+ data=Orthodont)
Analysis of Variance Table
        Df Sum Sq Mean Sq F value
Sex      1  9.591  9.5905 33.9645
Age      3 34.876 11.6252 41.1703
Sex:Age  3  2.930  0.9768  3.4594

The sum of squares for the Sex*Age interaction agrees with that from SAS.
lmer() leaves the user to work out an appropriate df for the F-statistic.  One
has, in agreement with the SAS output:
[1] 0.05318945

The main effects SS and F's are of course not expected to agree and 
indeed, in my strong view, true SAS type III SS's are inappropriate.

I regard this R analysis however as an inelegant use of the data, with low
power.  My book with John Braun (3rd edn and if I recall correctly, 2nd)
has an analysis that I am prepared to defend that uses lmer() from lme4.
Several years ago, I placed on the web a version of the analysis that uses
 lme() from nlme:
   http://maths.anu.edu.au/~johnm/r-book/xtras/mlm-lme.pdf
I'd forgotten that it was there.

This is a list for R users.  You will not necessarily find folk here with a high
level of SAS expertise, maybe not even enough to understand what the
SAS documentation means when it uses the term "unstructured".  Charles,
I think you've done pretty well in the amount of free advice that you have
received.  I think too that Steven McKinney's point is well made.  Kevin's
interpretation of the EULA is probably more or less correct, but the 
document comes across rather more ferociously than he suggests, and it
is not a good starting point for scientific assessment of the respective 
methodologies.  Many of us have other reasons why we are not very
interested in SAS does.  The implied threat in the EULA provides, even
if we are not party to any such agreement, just one more reason why SAS
is not to any large extent in our path ahead to the future.

John Maindonald             email: john.maindonald at anu.edu.au
phone : +61 2 (6125)3473    fax  : +61 2(6125)5549
Centre for Mathematics & Its Applications, Room 1194,
John Dedman Mathematical Sciences Building (Building 27)
Australian National University, Canberra ACT 0200.
http://www.maths.anu.edu.au/~johnm
On 27/01/2012, at 4:03 PM, Kevin Wright wrote:

            

Thread (19 messages)

Charles Determan Jr Trouble Replicating Unstructured Mixed Procedure in R Jan 24 Thompson,Paul Trouble Replicating Unstructured Mixed Procedure in R Jan 24 Charles Determan Jr Trouble Replicating Unstructured Mixed Procedure in R Jan 25 David Atkins Trouble Replicating Unstructured Mixed Procedure in R Jan 25 David Duffy Trouble Replicating Unstructured Mixed Procedure in R Jan 25 John Maindonald Trouble Replicating Unstructured Mixed Procedure in R Jan 25 Charles Determan Jr Trouble Replicating Unstructured Mixed Procedure in R Jan 26 Thompson,Paul Trouble Replicating Unstructured Mixed Procedure in R Jan 26 Luca Borger Trouble Replicating Unstructured Mixed Procedure in R Jan 26 Thompson,Paul Trouble Replicating Unstructured Mixed Procedure in R Jan 26 John Maindonald Trouble Replicating Unstructured Mixed Procedure in R Jan 26 Charles Determan Jr Trouble Replicating Unstructured Mixed Procedure in R Jan 26 Kevin Wright Trouble Replicating Unstructured Mixed Procedure in R Jan 26 John Maindonald Trouble Replicating Unstructured Mixed Procedure in R Jan 26 Charles Determan Jr Trouble Replicating Unstructured Mixed Procedure in R Jan 27 Charles Determan Jr Trouble Replicating Unstructured Mixed Procedure in R Jan 27 iwhite@staffmail.ed.ac.uk Trouble Replicating Unstructured Mixed Procedure in R Jan 27 Steven J. Pierce Trouble Replicating Unstructured Mixed Procedure in R Jan 27 Juliet Hannah Trouble Replicating Unstructured Mixed Procedure in R Jan 27