Learn R Programming

MBAnalysis (version 2.1.1)

predict.MBWCov: Prediction with MBWCov

Description

Computes predictions of Y from MBWCov using calibration X (default) or new X observations.

Usage

# S3 method for MBWCov
predict(object, newdata = object$call$X, ncomp = object$call$ncomp, ...)

Value

A matrix of predicted Y values where each row corresponds to an observation and each column corresponds to a Y variable.

Arguments

object

An object resulting from MBWCov.

newdata

A matrix or data.frame of (new) observations having the same ncol and same colnames as the X of fitting observations.

ncomp

The number of components to be considered in the model to perform the predictions. By default, all components computed in MBWCov are considered.

...

further arguments passed to or from other methods.

See Also

coef.MBWCov MBValidation

Examples

Run this code
data(ham)
X=ham$X
block=ham$block
Y=ham$Y
res.mbwcov <- MBWCov(X, Y, block, name.block = names(block))
predict(res.mbwcov)

Run the code above in your browser using DataLab