Learn R Programming

sommer (version 4.1.1)

predict.mmer: Predict form a LMM fitted with mmer

Description

predict method for class "mmer".

Usage

# S3 method for mmer
predict(object, classify=NULL,
        …)

Arguments

object

an object of class "mmer"

classify

an optional character string with the variables that define the margins of the multiway table to be predicted (see Details).

Further arguments to be passed

Value

The data frame used for obtaining the predictions, jointly with the predicted values and the corresponding standard errors.

Details

This function allows to produce predictions specifying those variables that define the margins of the hypertable to be predicted (argument classify). Predictions are obtained for each combination of values of the specified variables that is present in the data set used to fit the model. See vignettes for more details.

References

Welham, S., Cullis, B., Gogel, B., Gilmour, A., and Thompson, R. (2004). Prediction in linear mixed models. Australian and New Zealand Journal of Statistics, 46, 325 - 347.

See Also

predict, mmer

Examples

Run this code
# 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$pvals

p0 <- predict.mmer(object=m3, classify = "V")
p0$pvals

p0 <- predict.mmer(object=m3, classify = "B")
p0$pvals
# }

Run the code above in your browser using DataLab