Learn R Programming

multiblock (version 0.8.0)

rosa_results: Result functions for ROSA models

Description

Standard result computation and extraction functions for ROSA (rosa).

Usage

# S3 method for rosa
predict(
  object,
  newdata,
  ncomp = 1:object$ncomp,
  comps,
  type = c("response", "scores"),
  na.action = na.pass,
  ...
)

# S3 method for rosa coef(object, ncomp = object$ncomp, comps, intercept = FALSE, ...)

# S3 method for rosa print(x, ...)

# S3 method for rosa summary( object, what = c("all", "validation", "training"), digits = 4, print.gap = 2, ... )

blockexpl(object, ncomp = object$ncomp, type = c("train", "CV"))

# S3 method for rosaexpl print(x, digits = 3, compwise = FALSE, ...)

rosa.classify(object, classes, newdata, ncomp, LQ)

# S3 method for rosa scores(object, ...)

# S3 method for rosa loadings(object, ...)

Arguments

object

A rosa object.

newdata

Optional new data with the same types of predictor blocks as the ones used for fitting the object.

ncomp

An integer giving the number of components to use apply.

comps

An integer vector giving the exact components to apply.

type

Character indicating which type of explained variance to compute (default = "train", alternative = "CV").

na.action

Function determining what to do with missing values in newdata.

...

Additional arguments. Currently not implemented.

intercept

A logical indicating if coefficients for the intercept should be included (default = FALSE).

x

A rosa object.

what

A character indicating if summary should include all, validation or training.

digits

The number of digits used for printing.

print.gap

Gap between columns when printing.

compwise

Logical indicating if block-wise (default/FALSE) or component-wise (TRUE) explained variance should be printed.

classes

A character vector of class labels.

LQ

A character indicating if 'max' (maximum score value), 'lda' or 'qda' should be used when classifying.

Value

Returns depend on method used, e.g. predict.rosa returns predicted responses or scores depending on inputs, coef.rosa returns regression coefficients, blockexpl returns an object of class rosaexpl containing block-wise and component-wise explained variance contained in a matrix with attributes.

Details

Usage of the functions are shown using generics in the examples below. Prediction, regression coefficients, object printing and summary are available through: predict.rosa, coef.rosa, print.rosa and summary.rosa. Explained variances are available (block-wise and global) through blockexpl and print.rosaexpl. Scores and loadings have their own extensions of scores() and loadings() throught scores.rosa and loadings.rosa. Finally, there is work in progress on classifcation support through rosa.classify.

References

Liland, K.H., N<U+00E6>s, T., and Indahl, U.G. (2016). ROSA - a fast extension of partial least squares regression for multiblock data analysis. Journal of Chemometrics, 30, 651<U+2013>662, doi:10.1002/cem.2824.

See Also

Overviews of available methods, multiblock, and methods organised by main structure: basic, unsupervised, asca, supervised and complex. Common functions for computation and extraction of results and plotting are found in rosa_results and rosa_plots, respectively.

Examples

Run this code
# NOT RUN {
data(potato)
mod <- rosa(Sensory[,1] ~ ., data = potato, ncomp = 5, subset = 1:20)
testset <- potato[-(1:20),]; testset$Sensory <- testset$Sensory[,1,drop=FALSE]
predict(mod, testset, ncomp=5)
dim(coef(mod, ncomp=5)) # <variables x responses x components>
print(mod)
summary(mod)
blockexpl(mod)
print(blockexpl(mod), compwise=TRUE)

# }

Run the code above in your browser using DataLab