sopls_results {multiblock} | R Documentation |
Result functions for SO-PLS models
Description
Standard result functions for SO-PLS (sopls
).
Usage
## S3 method for class 'sopls'
predict(
object,
newdata,
ncomp = object$ncomp,
type = c("response", "scores"),
na.action = na.pass,
...
)
## S3 method for class 'sopls'
coef(object, ncomp = object$ncomp, intercept = FALSE, ...)
## S3 method for class 'sopls'
print(x, ...)
## S3 method for class 'sopls'
summary(
object,
what = c("all", "validation", "training"),
digits = 4,
print.gap = 2,
...
)
classify(object, ...)
## S3 method for class 'sopls'
classify(object, classes, newdata, ncomp, LQ = "LDA", ...)
## S3 method for class 'sopls'
R2(object, estimate, newdata, ncomp = "all", individual = FALSE, ...)
## S3 method for class 'sopls'
RMSEP(object, estimate, newdata, ncomp = "all", individual = FALSE, ...)
pcp(object, ...)
## S3 method for class 'sopls'
pcp(object, ncomp, ...)
## Default S3 method:
pcp(object, X, ...)
cvanova(pred, ...)
## Default S3 method:
cvanova(pred, true, absRes = TRUE, ...)
## S3 method for class 'sopls'
cvanova(pred, comps, absRes = TRUE, ...)
## S3 method for class 'cvanova'
print(x, ...)
## S3 method for class 'cvanova'
summary(object, ...)
## S3 method for class 'cvanova'
plot(x, ...)
## S3 method for class 'sopls'
residuals(object, ...)
Arguments
object |
A |
newdata |
Optional new data with the same types of predictor blocks as the ones used for fitting the object. |
ncomp |
An |
type |
A |
na.action |
Function determining what to do with missing values in |
... |
Additional arguments. Currently not implemented. |
intercept |
A |
x |
A |
what |
A |
digits |
The number of digits used for printing. |
print.gap |
Gap between columns when printing. |
classes |
A |
LQ |
A |
estimate |
A |
individual |
A |
X |
A |
pred |
An object holding the CV-predicted values ( |
true |
A |
absRes |
A |
comps |
An |
Details
The parameter ncomp
controls
which components to apply/extract, resulting in the sequence of components leading up to the specific choice, i.e.
ncomp = c(2,2,1)
results in the sequence 1,0,0; 2,0,0; 2,1,0; 2,2,0; 2,2,1.
Usage of the functions are shown using generics in the examples below.
Prediction, regression coefficients, object printing and summary are available through:
predict.sopls
, coef.sopls
, print.sopls
and summary.sopls
.
Explained variances and RMSEP are available through R2.sopls
and RMSEP.sopls
.
Principal components of predictions are available through pcp.sopls
. Finally, there is work in progress on classifcation
support through classify.sopls
.
Value
Returns depend on method used, e.g. predict.sopls
returns predicted responses
or scores depending on inputs, coef.sopls
return regression coefficients, while print and summary methods return the object invisibly.
References
Jørgensen K, Mevik BH, Næs T. Combining designed experiments with several blocks of spectroscopic data. Chemometr Intell Lab Syst. 2007;88(2): 154–166.
See Also
Overviews of available methods, multiblock
, and methods organised by main structure: basic
, unsupervised
, asca
, supervised
and complex
.
Common functions for plotting are found in sopls_plots
.
Examples
data(potato)
mod <- sopls(Sensory[,1] ~ ., data = potato[c(1:3,9)], ncomp = 5, subset = 1:20)
testset <- potato[-(1:20),]; testset$Sensory <- testset$Sensory[,1,drop=FALSE]
predict(mod, testset, ncomp=c(2,1,2))
dim(coef(mod, ncomp=c(3,0,1))) # <variables x responses x components>
R2(mod, ncomp = c(4,1,2))
print(mod)
summary(mod)
# PCP from sopls object
modMulti <- sopls(Sensory ~ ., data = potato[c(1:3,9)], ncomp = 5, validation = "CV", segment = 5)
(PCP <- pcp(modMulti, c(2,1,2)))
scoreplot(PCP)
# PCP from matrices
preds <- modMulti$validation$Ypred[,,"2,1,2"]
PCP_default <- pcp(preds, potato[1:3])
# CVANOVA
modCV <- sopls(Sensory[,1] ~ ., data = potato[c(1:3,9)], ncomp = 5, validation = "CV", segment = 5)
summary(cva <- cvanova(modCV, "2,1,2"))
plot(cva)