Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pls

Partial Least Squares modelling of ER objects.


Description

Partial Least Squares modelling of ER objects.

Usage

pls(er, ...)

## S3 method for class 'ER'
pls(
  er,
  effect,
  ncomp,
  newdata = NULL,
  er2,
  validation,
  jackknife = NULL,
  shave = NULL,
  df.used = NULL,
  ...
)

Arguments

er

Object of class ER.

...

Additional arguments for plsr.

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 ER for comparison.

validation

Optional validation parameters for plsr.

jackknife

Optional argument specifying if jackknifing should be applied.

shave

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).

df.used

Optional argument indicating how many degrees of freedom have been consumed during deflation. Default value from input object.

See Also

Examples

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

ER

Effect + Residual Modelling

v1.1.0
GPL
Authors
Kristian Hovde Liland [aut, cre], Ellen Færgestad Mosleth [ctb]
Initial release
2021-03-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.