Learn R Programming

statgenGxE (version 1.0.2)

predict.varComp: Predictions based on a fitted varComp model.

Description

Predictions are made based on the fitted model in the varComp object. These predictions can be at genotype level, at genotype x trial level or at the level of genotype x nestingFactor. If the model was fitted with trial as year x location then genotype x trial level becomes genotype x year x location.

Usage

# S3 method for varComp
predict(
  object,
  ...,
  predictLevel = c("genotype", "trial", object$nestingFactor)
)

Arguments

object

An object of class varComp.

...

Not used.

predictLevel

A character string, the level at which prediction should be made. Either "genotype" for prediction at genotype level, "trial" for predictions at genotype x trial level or the variable used as nesting factor for predictions at the level of genotype x nestingFactor level.

Value

A data.frame with predictions.

See Also

Other Mixed model analysis: CRDR(), correlations(), diagnostics(), gxeVarComp(), herit(), plot.varComp(), vc()

Examples

Run this code
# NOT RUN {
## Fit a mixed model.
geVarComp <- gxeVarComp(TD = TDMaize, trait = "yld")

## Predictions at genotype level.
predGeno <- predict(geVarComp)
head(predGeno)

## Predictions at genotype x trial level.
predGenoTrial <- predict(geVarComp, predictLevel = "trial")
head(predGenoTrial)

# }

Run the code above in your browser using DataLab