Dear list members,
I try to simulate an incomplete block design in which every participants
receives 3 out of 4 possible treatment. The outcome in binary.
Assigning a binary outcome to the BIB or PBIB dataset of the package
SASmixed gives the appropriate output.
With the code below, fixed treatment estimates are not given for each of
the 4 possible treatments, instead a kind of summary measure(?) for
'treatment' is given.
block<-rep(1:24,each=3)
treatment<-c(1, 2, 3, 2, 1, 4, 3, 4, 1, 4, 3, 2, 1, 3, 4, 2, 4, 3, 3, 1,
2, 4, 2, 1, 1, 4, 2, 2, 3, 1, 3, 2, 4, 4, 1, 3, 1, 2, 3, 2, 1, 4, 3, 4,
1, 4, 3, 2, 1, 3, 4, 2, 4, 3, 3, 1, 2, 4, 2, 1, 1, 4, 2, 2, 3, 1, 3, 2,
4, 4, 1, 3)
outcome<-c(0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0,
0, 0, 1, 0)
data<-data.frame(block,treatment,outcome)
lmer(outcome~treatment +(1|block), family=binomial, data=data)
Is this a problem with the recovery of interblock estimates? Are there
special rules how incomplete block designs should look like to enable
this recovery?
Any help is appreciated!
Regards,
Christian
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.