Questions on PCR with regard to Output

The model object has quite a bit under the hood:

library(pls)
#> 
#> Attaching package: 'pls'
#> The following object is masked from 'package:stats':
#> 
#>     loadings

test <- iris[,c(1:4)]
model <- pcr(Sepal.Length ~ ., data = iris, scale = TRUE, validation = "CV")

summary(model)
#> Data:    X dimension: 150 5 
#>  Y dimension: 150 1
#> Fit method: svdpc
#> Number of components considered: 5
#> 
#> VALIDATION: RMSEP
#> Cross-validated using 10 random segments.
#>        (Intercept)  1 comps  2 comps  3 comps  4 comps  5 comps
#> CV          0.8308   0.5114   0.5067   0.3935   0.3288   0.3137
#> adjCV       0.8308   0.5110   0.5062   0.3930   0.3284   0.3130
#> 
#> TRAINING: % variance explained
#>               1 comps  2 comps  3 comps  4 comps  5 comps
#> X               56.20    88.62    99.07    99.73   100.00
#> Sepal.Length    62.71    63.58    78.44    84.95    86.73
str(model)
#> List of 19
#>  $ coefficients : num [1:5, 1, 1:5] -0.118 0.226 0.226 0.018 0.19 ...
#>   ..- attr(*, "dimnames")=List of 3
#>   .. ..$ : chr [1:5] "Sepal.Width" "Petal.Length" "Petal.Width" "Speciesversicolor" ...
#>   .. ..$ : chr "Sepal.Length"
#>   .. ..$ : chr [1:5] "1 comps" "2 comps" "3 comps" "4 comps" ...
#>  $ scores       : 'scores' num [1:150, 1:5] -2.21 -1.87 -2.04 -1.9 -2.28 ...
#>   ..- attr(*, "dimnames")=List of 2
#>   .. ..$ : chr [1:150] "1" "2" "3" "4" ...
#>   .. ..$ : chr [1:5] "Comp 1" "Comp 2" "Comp 3" "Comp 4" ...
#>  $ loadings     : 'loadings' num [1:5, 1:5] -0.3024 0.5785 0.5788 0.0459 0.4866 ...
#>   ..- attr(*, "dimnames")=List of 2
#>   .. ..$ : chr [1:5] "Sepal.Width" "Petal.Length" "Petal.Width" "Speciesversicolor" ...
#>   .. ..$ : chr [1:5] "Comp 1" "Comp 2" "Comp 3" "Comp 4" ...
#>  $ Yloadings    : 'loadings' num [1, 1:5] 0.3912 -0.0608 -0.4415 1.1631 0.9457
#>   ..- attr(*, "dimnames")=List of 2
#>   .. ..$ : chr "Sepal.Length"
#>   .. ..$ : chr [1:5] "Comp 1" "Comp 2" "Comp 3" "Comp 4" ...
#>  $ projection   : num [1:5, 1:5] -0.3024 0.5785 0.5788 0.0459 0.4866 ...
#>   ..- attr(*, "dimnames")=List of 2
#>   .. ..$ : chr [1:5] "Sepal.Width" "Petal.Length" "Petal.Width" "Speciesversicolor" ...
#>   .. ..$ : chr [1:5] "Comp 1" "Comp 2" "Comp 3" "Comp 4" ...
#>  $ Xmeans       : Named num [1:5] 7.014 2.129 1.573 0.705 0.705
#>   ..- attr(*, "names")= chr [1:5] "Sepal.Width" "Petal.Length" "Petal.Width" "Speciesversicolor" ...
#>  $ Ymeans       : Named num 5.84
#>   ..- attr(*, "names")= chr "Sepal.Length"
#>  $ fitted.values: num [1:150, 1, 1:5] 4.98 5.11 5.05 5.1 4.95 ...
#>   ..- attr(*, "dimnames")=List of 3
#>   .. ..$ : chr [1:150] "1" "2" "3" "4" ...
#>   .. ..$ : chr "Sepal.Length"
#>   .. ..$ : chr [1:5] "1 comps" "2 comps" "3 comps" "4 comps" ...
#>  $ residuals    : num [1:150, 1, 1:5] 0.1228 -0.2129 -0.3458 -0.4986 0.0499 ...
#>   ..- attr(*, "dimnames")=List of 3
#>   .. ..$ : chr [1:150] "1" "2" "3" "4" ...
#>   .. ..$ : chr "Sepal.Length"
#>   .. ..$ : chr [1:5] "1 comps" "2 comps" "3 comps" "4 comps" ...
#>  $ Xvar         : Named num [1:5] 418.65 241.53 77.86 4.91 2.04
#>   ..- attr(*, "names")= chr [1:5] "Comp 1" "Comp 2" "Comp 3" "Comp 4" ...
#>  $ Xtotvar      : num 745
#>  $ fit.time     : Named num 0
#>   ..- attr(*, "names")= chr "elapsed"
#>  $ ncomp        : num 5
#>  $ method       : chr "svdpc"
#>  $ scale        : Named num [1:5] 0.436 1.765 0.762 0.473 0.473
#>   ..- attr(*, "names")= chr [1:5] "Sepal.Width" "Petal.Length" "Petal.Width" "Speciesversicolor" ...
#>  $ validation   :List of 9
#>   ..$ method      : chr "CV"
#>   ..$ pred        : num [1:150, 1, 1:5] 4.99 5.11 5.02 5.12 4.96 ...
#>   .. ..- attr(*, "dimnames")=List of 3
#>   .. .. ..$ : chr [1:150] "1" "2" "3" "4" ...
#>   .. .. ..$ : chr "Sepal.Length"
#>   .. .. ..$ : chr [1:5] "1 comps" "2 comps" "3 comps" "4 comps" ...
#>   ..$ coefficients: NULL
#>   ..$ gammas      : NULL
#>   ..$ PRESS0      : Named num 104
#>   .. ..- attr(*, "names")= chr "Sepal.Length"
#>   ..$ PRESS       : num [1, 1:5] 39.2 38.5 23.2 16.2 14.8
#>   .. ..- attr(*, "dimnames")=List of 2
#>   .. .. ..$ : chr "Sepal.Length"
#>   .. .. ..$ : chr [1:5] "1 comps" "2 comps" "3 comps" "4 comps" ...
#>   ..$ adj         : num [1, 1:5] 0.2544 0.2485 0.1473 0.1028 0.0908
#>   .. ..- attr(*, "dimnames")=List of 2
#>   .. .. ..$ : chr "Sepal.Length"
#>   .. .. ..$ : chr [1:5] "1 comps" "2 comps" "3 comps" "4 comps" ...
#>   ..$ segments    :List of 10
#>   .. ..$ V1 : int [1:15] 18 128 8 93 76 85 113 129 112 60 ...
#>   .. ..$ V2 : int [1:15] 59 26 149 16 41 33 75 38 19 114 ...
#>   .. ..$ V3 : int [1:15] 90 101 15 73 143 147 25 138 70 111 ...
#>   .. ..$ V4 : int [1:15] 14 40 146 11 69 42 115 148 51 30 ...
#>   .. ..$ V5 : int [1:15] 122 65 53 28 102 3 57 17 86 131 ...
#>   .. ..$ V6 : int [1:15] 106 56 105 79 120 133 9 71 144 123 ...
#>   .. ..$ V7 : int [1:15] 35 119 107 10 45 44 127 134 100 37 ...
#>   .. ..$ V8 : int [1:15] 92 23 132 2 34 109 150 104 139 62 ...
#>   .. ..$ V9 : int [1:15] 22 137 27 124 7 84 87 74 96 140 ...
#>   .. ..$ V10: int [1:15] 6 136 31 89 121 46 13 64 78 116 ...
#>   .. ..- attr(*, "incomplete")= num 0
#>   .. ..- attr(*, "type")= chr "random"
#>   ..$ ncomp       : num 5
#>  $ call         : language pcr(formula = Sepal.Length ~ ., data = iris, scale = TRUE, validation = "CV")
#>  $ terms        :Classes 'terms', 'formula'  language Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width + Species
#>   .. ..- attr(*, "variables")= language list(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width, Species)
#>   .. ..- attr(*, "factors")= int [1:5, 1:4] 0 1 0 0 0 0 0 1 0 0 ...
#>   .. .. ..- attr(*, "dimnames")=List of 2
#>   .. .. .. ..$ : chr [1:5] "Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width" ...
#>   .. .. .. ..$ : chr [1:4] "Sepal.Width" "Petal.Length" "Petal.Width" "Species"
#>   .. ..- attr(*, "term.labels")= chr [1:4] "Sepal.Width" "Petal.Length" "Petal.Width" "Species"
#>   .. ..- attr(*, "order")= int [1:4] 1 1 1 1
#>   .. ..- attr(*, "intercept")= int 1
#>   .. ..- attr(*, "response")= int 1
#>   .. ..- attr(*, ".Environment")=<environment: R_GlobalEnv> 
#>   .. ..- attr(*, "predvars")= language list(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width, Species)
#>   .. ..- attr(*, "dataClasses")= Named chr [1:5] "numeric" "numeric" "numeric" "numeric" ...
#>   .. .. ..- attr(*, "names")= chr [1:5] "Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width" ...
#>  $ model        :'data.frame':   150 obs. of  5 variables:
#>   ..$ Sepal.Length: num [1:150] 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...
#>   ..$ Sepal.Width : num [1:150] 3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ...
#>   ..$ Petal.Length: num [1:150] 1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...
#>   ..$ Petal.Width : num [1:150] 0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ...
#>   ..$ Species     : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ...
#>   ..- attr(*, "terms")=Classes 'terms', 'formula'  language Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width + Species
#>   .. .. ..- attr(*, "variables")= language list(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width, Species)
#>   .. .. ..- attr(*, "factors")= int [1:5, 1:4] 0 1 0 0 0 0 0 1 0 0 ...
#>   .. .. .. ..- attr(*, "dimnames")=List of 2
#>   .. .. .. .. ..$ : chr [1:5] "Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width" ...
#>   .. .. .. .. ..$ : chr [1:4] "Sepal.Width" "Petal.Length" "Petal.Width" "Species"
#>   .. .. ..- attr(*, "term.labels")= chr [1:4] "Sepal.Width" "Petal.Length" "Petal.Width" "Species"
#>   .. .. ..- attr(*, "order")= int [1:4] 1 1 1 1
#>   .. .. ..- attr(*, "intercept")= int 1
#>   .. .. ..- attr(*, "response")= int 1
#>   .. .. ..- attr(*, ".Environment")=<environment: R_GlobalEnv> 
#>   .. .. ..- attr(*, "predvars")= language list(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width, Species)
#>   .. .. ..- attr(*, "dataClasses")= Named chr [1:5] "numeric" "numeric" "numeric" "numeric" ...
#>   .. .. .. ..- attr(*, "names")= chr [1:5] "Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width" ...
#>  - attr(*, "class")= chr "mvr"

Created on 2020-01-10 by the reprex package (v0.3.0)