predict.msma: Prediction

Description Usage Arguments Details Value Examples

View source: R/src.r

Description

predict method for class "msma".

Usage

1
2
## S3 method for class 'msma'
predict(object, newX, newY = NULL, ...)

Arguments

object

an object of class "msma", usually, a result of a call to msma

newX

a matrix in which to look for variables with which to predict X.

newY

a matrix in which to look for variables with which to predict Y.

...

further arguments passed to or from other methods.

Details

This function produces a prediction from new data based on msma fit. It is mainly used in cross-validation

Value

X

predicted X

sbX

block score for X

Y

predicted Y

sbY

block score for Y

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
##### data #####
tmpdata = simdata(n = 50, rho = 0.8, Yps = c(10, 12, 15), Xps = 20, seed=1)
X = tmpdata$X; Y = tmpdata$Y 

##### Two Component #####
fit2 = msma(X, Y, comp=2, lambdaX=2, lambdaY=1:3)
summary(fit2)

##### Predict #####
test = predict(fit2, newX=X, newY=Y)

msma documentation built on June 25, 2021, 5:09 p.m.