Skip to content
Prev 76666 / 398502 Next

specification for glmmPQL

Hello Dr. Bates and group,

I understand, the attached data file did not accompany my original 
message. I have listed below the code used to create that file.

data.1 <- data.frame(subject  = factor(rep(c("one", "two", "three", "four",
                                             "five", "six", "seven", 
"eight"),
                                           each = 4),
                                       levels = c("one", "two", "three",
                                                  "four", "five", "six",
                                                  "seven", "eight")),
                     day      = factor(rep(c("one", "two", "three", "four"),
                                           times = 8),
                                       levels = c("one", "two", "three",
                                                  "four")),
                     expt     = rep(c("control", "treatment"), each = 16),
                     response = c(58, 63, 57, 54, 63, 59, 61, 53, 52, 62,
                                  46, 55, 59, 63, 58, 59, 62, 59, 64, 53,
                                  63, 75, 62, 64, 53, 58, 62, 53, 64, 72,
                                  65, 74))

mtrx.1 <- matrix(apply(data.1[, -4], 2, function(x)
                 rep(x, 100 - data.1$response)), ncol = 3, byrow = F)
mtrx.2 <- matrix(apply(data.1[, -4], 2, function(x)
                 rep(x, data.1$response)), ncol = 3, byrow = F)
                
data.2 <- data.frame(subject  = factor(c(mtrx.1[,1], mtrx.2[,1]),
                                       levels = c("one", "two", "three",
                                                  "four", "five", "six",
                                                  "seven", "eight")),
                     day      = factor(c(mtrx.1[,2], mtrx.2[,2]),
                                       levels = c("one", "two", "three",
                                                  "four")),
                     expt     = factor(c(mtrx.1[,3], mtrx.2[,3]),
                                       levels = c("control", "treatment")),
                     response = factor(c(rep("yes", nrow(mtrx.1)),
                                         rep("no", nrow(mtrx.2))),
                                       levels = c("yes", "no")))

#-------------------------------------------------------------------------------#
Douglas Bates wrote: