[R-sig-ME] Treatment:Block interactions in lme (Schabenberger & Pierce 2002)
Christoph Scherber
Christoph.Scherber at agr.uni-goettingen.de
Thu Nov 15 15:45:39 CET 2012
Dear all,
I have tried to reproduce the SAS example from Schabenberger & Pierce (2002, p. 474 f.), but
couldn´t figure out so far how to fit a farm:treatment (tx) random interaction term.
The data are structured as follows:
- yield is the response variable
- tx (treatment) is the only fixed effect
- farm, block and tx are random effects
Schabenberger & Pierce fit the following model:
fixed effects: tx
random effects: block/farm plus *random interaction term for farm and treatment*
I´ve started with lme as follows:
farmdata=data.frame(farm,tx,block,yield)
m1=lme(yield~treatment,random=~1|farm/block/treatment,farmdata)
But this is obviously wrong as I´d be interested in the treatment:farm interaction.
I guess I´d need to set this up using the pdMat() classes (pdIdent, pdBlocked)?
Any help would be greatly appreciated!
Best wishes
Christoph
(using R 2.15.1 on Windows 7 Professional 32-bit).
####
farm tx block yield
1 A 1 30.8601
1 A 2 30.3216
1 A 3 32.3135
1 B 1 33.3089
1 B 2 30.943
1 B 3 35.2381
2 A 1 31.3924
2 A 2 30.6227
2 A 3 29.9349
2 B 1 27.8756
2 B 2 25.2517
2 B 3 21.7799
3 A 1 39.216
3 A 2 38.9588
3 A 3 35.386
3 B 1 41.9458
3 B 2 43.3782
3 B 3 41.0985
4 A 1 37.1987
4 A 2 36.1024
4 A 3 35.8494
4 B 1 30.9673
4 B 2 32.5553
4 B 3 33.0424
5 A 1 24.9758
5 A 2 22.0432
5 A 3 22.9343
5 B 1 23.3903
5 B 2 24.5053
5 B 3 23.2413
6 A 1 28.059
6 A 2 27.9827
6 A 3 25.1334
6 B 1 28.6984
6 B 2 25.6783
6 B 3 25.8853
7 A 1 27.8232
7 A 2 25.3218
7 A 3 26.5197
7 B 1 37.2286
7 B 2 34.4472
7 B 3 32.4972
8 A 1 29.4101
8 A 2 26.6327
8 A 3 29.6004
8 B 1 30.9808
8 B 2 30.7152
8 B 3 30.6305
--
PD Dr Christoph Scherber
Georg-August University Goettingen
Department of Crop Science
Agroecology
Grisebachstrasse 6
D-37077 Goettingen
Germany
phone 0049 (0)551 39 8807
fax 0049 (0)551 39 8806
http://www.gwdg.de/~cscherb1
More information about the R-sig-mixed-models
mailing list