get_coef.Rd
Computes the standardized and raw coefficients of a PLS regression, with p-values and confidence intervals from a jackknife procedure.
get_coef(object, y = NULL, ncomp = NULL,
ci = 0.95, raw = FALSE)
an object of class mvr
from pls
package. It must be cross-validated with jackknife = TRUE
the name of the response variable whose coefficients are plotted. If NULL
(default), the first response variable is used.
the number of components to use for computing coefficients
the confidence level of the confidence interval. Default is 0.95.
logical. If FALSE
(default), standardized coefficients are computed. If TRUE
, raw coefficients are computed.
A data frame with coefficients, standard deviation, t-values, p-values and confidence intervals.
Martens, H., Næs, T. (1989) Multivariate calibration. Chichester: Wiley.
Tenenhaus, M. (1998) La Regression PLS. Theorie et Pratique. Editions TECHNIP, Paris.
library(pls)
data(yarn)
pls <- mvr(density ~ NIR,
ncomp = 5,
data = yarn,
validation = "CV",
method = "oscorespls",
jackknife = TRUE)
res <- get_coef(pls)
head(res)
#> coefficients std error t-value p-value 2.5% 97.5%
#> NIR1 -1.17513 1.23516 -0.951 0.36625 -3.70947 1.35921
#> NIR2 -1.67001 1.05821 -1.578 0.14899 -3.84128 0.50125
#> NIR3 -1.57675 0.77924 -2.023 0.07371 -3.17562 0.02213
#> NIR4 -0.43207 0.62576 -0.690 0.50731 -1.71603 0.85189
#> NIR5 0.73404 0.45829 1.602 0.14369 -0.20630 1.67437
#> NIR6 1.32103 0.36179 3.651 0.00531 0.57870 2.06335