# NOT RUN {
data(DT_yatesoats)
DT <- DT_yatesoats
m3 <- mmer(fixed=Y ~ V + N + V:N,
random = ~ B + B:MP,
rcov=~units,
data = DT)
summary(m3)$varcomp
p0 <- predict.mmer(object=m3, classify = "N")
p0$hypertable; p0$pvals
p0 <- predict.mmer(object=m3, classify = "V")
p0$hypertable; p0$pvals
p0 <- predict.mmer(object=m3, classify = "B")
p0$hypertable; p0$pvals
p0 <- predict.mmer(object=m3, classify = c("V","N"))
p0$hypertable; p0$pvals
########################################
## Modify terms in the prediction
## Ignore a term: it doesn't include the
## model matrix in the BLUP and its SE
########################################
p0 <- predict.mmer(object=m3, classify = "N")
# modify the prediction
hypertable <- p0$hypertable; hypertable
# ignore the B:MP random term
hypertable[6,c("ignored","include","average")] <- c(TRUE,FALSE,FALSE)
hypertable
p1 <- predict.mmer(object=m3, classify = "N", hypertable = hypertable)
p1$pvals
########################################
## Modify terms in the prediction
## Average a term: it fills the model matrix
## for the term with 1/#levels affecting
## the BLUP and its SE
########################################
p0 <- predict.mmer(object=m3, classify = "N")
# modify the prediction
hypertable <- p0$hypertable; hypertable
# average the V:N fixed term
hypertable[4,c("ignored","include","average")] <- c(FALSE,TRUE,TRUE)
hypertable
p1 <- predict.mmer(object=m3, classify = "N", hypertable = hypertable)
p1$pvals
# }
Run the code above in your browser using DataLab