
Last chance! 50% off unlimited learning
Sale ends in
The output of ER
is used as input to a PLS classification with the selected
effect as response. It is possible to compare two models using the er2
argument. Variable
selection is available through Jackknifing (from package pls
) and Shaving (from package plsVarSel
).
pls(er, ...)# S3 method for ER
pls(
er,
effect,
ncomp,
newdata = NULL,
er2,
validation,
jackknife = NULL,
shave = NULL,
df.used = NULL,
...
)
Object of class ER
.
Additional arguments for plsr
.
The effect to be used as response.
Number of PLS components.
Optional new data matrix for prediction.
Second object of class ER
for comparison.
Optional validation parameters for plsr
.
Optional argument specifying if jackknifing should be applied.
Optional argument indicating if variable shaving should be used. shave
should be a list with two elements: the PLS filter method and the proportion to remove. shave = TRUE
uses defaults: list("sMC", 0.2)
.
Optional argument indicating how many degrees of freedom have been consumed during deflation. Default value from input object.
If using the shave
options, the segment type is given as type
instead of segment.type
(see examples).
ER
, elastic
and confints
.
data(MS, package = "ER")
er <- ER(proteins ~ MS * cluster, data = MS[-1,])
# Simple PLS using interleaved cross-validation
plsMod <- pls(er, 'MS', 6, validation = "CV",
segment.type = "interleaved", length.seg = 25)
scoreplot(plsMod, labels = "names")
# PLS with shaving of variables (mind different variable for cross-validation type)
plsModS <- pls(er, 'MS', 6, validation = "CV",
type = "interleaved", length.seg=25, shave = TRUE)
# Error as a function of remaining variables
plot(plsModS$shave)
# Selected variables for minimum error
with(plsModS$shave, colnames(X)[variables[[min.red+1]]])
# Time consuming due to leave-one-out cross-validation
plsModJ <- pls(er, 'MS', 5, validation = "LOO",
jackknife = TRUE)
colSums(plsModJ$classes == as.numeric(MS$MS[-1]))
# Jackknifed coefficient P-values (sorted)
plot(sort(plsModJ$jack[,1,1]), pch = '.', ylab = 'P-value')
abline(h=c(0.01,0.05),col=2:3)
scoreplot(plsModJ)
scoreplot(plsModJ, comps=c(1,3)) # Selected components
# Use MS categories for colouring and clusters for plot characters.
scoreplot(plsModJ, col = er$symbolicDesign[['MS']],
pch = 20+as.numeric(er$symbolicDesign[['cluster']]))
loadingplot(plsModJ, scatter=TRUE) # scatter=TRUE for scatter plot
Run the code above in your browser using DataLab