pls {ER} | R Documentation |
Partial Least Squares modelling of ER objects.
pls(er, ...)
## S3 method for class 'ER'
pls(
er,
effect,
ncomp,
newdata = NULL,
er2,
validation,
jackknife = NULL,
shave = NULL,
df.used = NULL,
...
)
er |
Object of class |
... |
Additional arguments for |
effect |
The effect to be used as response. |
ncomp |
Number of PLS components. |
newdata |
Optional new data matrix for prediction. |
er2 |
Second object of class |
validation |
Optional validation parameters for |
jackknife |
Optional argument specifying if jackknifing should be applied. |
shave |
Optional argument indicating if variable shaving should be used. |
df.used |
Optional argument indicating how many degrees of freedom have been consumed during deflation. Default value from input object. |
data(MS, package = "ER")
er <- ER(proteins ~ MS * cluster, data = MS[-1,])
plsMod <- pls(er, 'MS', 6, validation = "CV",
type = "interleaved", length.seg=25, shave = TRUE)
# Error as a function of remaining variables
plot(plsMod$shave)
# Selected variables for minimum error
with(plsMod$shave, colnames(X)[variables[[min.red+1]]])
plsMod <- pls(er, 'MS', 5, validation = "LOO",
type = "interleaved", length.seg=25, jackknife = TRUE)
colSums(plsMod$classes == as.numeric(MS$MS[-1]))
# Jackknifed coefficient P-values (sorted)
plot(sort(plsMod$jack[,1,1]), pch = '.', ylab = 'P-value')
abline(h=c(0.01,0.05),col=2:3)
scoreplot(plsMod)
scoreplot(plsMod, comps=c(1,3)) # Selected components
# Use MS categories for colouring and clusters for plot characters.
scoreplot(plsMod, col = er$symbolicDesign[['MS']],
pch = 20+as.numeric(er$symbolicDesign[['cluster']]))
loadingplot(plsMod, scatter=TRUE) # scatter=TRUE for scatter plot