Skip to content
Prev 68585 / 398506 Next

random interactions in lme

The code below gives almost identical results for a split-block analysis in
lme and SAS proc mixed, in terms of variance components and F statistics. It
just extends the example in Pinheiro & Bates (p.162) to a split block
design. 

I am including below the SAS code and the data in case you want to try it.
The only difference between both is in the df for the F denominator, which I
wasn't able to compute correctly in lme, but this may be my ignorance on how
to correctly specify the model. It is not a big issue though, as the F
values are identical, so you can compute the p-values if you know how to
obtain the correct DenDF. 

# a split block design
spbl.an1<-lme(yield~rowspace*ordered(tpop),random=list(rep=pdBlocked(list(pd
Ident(~1),
pdIdent(~rowspace-1),pdIdent(~ordered(tpop)-1)))),data=spblock)

* SAS code
proc mixed data=splitblock method=reml;
class rep rowspace tpop;
model yield=rowspace tpop rowspace*tpop;
random rep rep*rowspace rep*tpop;
run;


# data

rowspace	tpop	rep	plot	yield
9	60	1	133	19
9	120	1	101	19.5
9	180	1	117	22
9	240	1	132	19.4
9	300	1	116	23.9
18	60	1	134	15.8
18	120	1	102	26.2
18	180	1	118	21.9
18	240	1	131	20
18	300	1	115	23.3
9	60	2	216	20.6
9	120	2	233	22
9	180	2	201	23.4
9	240	2	217	28.2
9	300	2	232	25.9
18	60	2	215	19.7
18	120	2	234	30.3
18	180	2	202	22.4
18	240	2	218	27.9
18	300	2	231	28.5
9	60	3	309	20.8
9	120	3	308	21.6
9	180	3	324	24.6
9	240	3	340	25.3
9	300	3	325	35.3
18	60	3	310	17.2
18	120	3	307	23.6
18	180	3	323	24.9
18	240	3	339	30.7
18	300	3	326	33
9	60	4	435	15.6
9	120	4	403	20.4
9	180	4	430	24.4
9	240	4	414	21
9	300	4	419	23.2
18	60	4	436	17.7
18	120	4	404	23.6
18	180	4	429	21.7
18	240	4	413	24.4
18	300	4	420	26.2


Ignacio


-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Douglas Bates
Sent: Monday, April 25, 2005 6:40 PM
To: Jacob Michaelson
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] random interactions in lme
Jacob Michaelson wrote:
:
Unfortunately, yes I do know what the error message is referring to - a 
condition that should not happen.  This is what Bill Venables would call 
an "infelicity" in the code and others with less tact than Bill might 
call a bug.

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html