Partial least squares regression (PLS)
MinutePlot® and R on the same data. MinutePlot version 1.0.0; R 4.5.2.
Dataset
- oliveoil (pls package) — Sixteen olive oils (Greek, Italian, Spanish): five chemical measurements (acidity, peroxide value, K232, K270, DK) and six sensory-panel scores (R: pls::oliveoil). Both tables are hosted; the entry predicts the sensory attribute yellow from the five chemical variables.
- Data format for MinutePlot: oliveoil_minuteplot.csv — arranged exactly as the app’s data template for this test expects (paste it into the app).
- Data format for R: oliveoil_chemical.csv and oliveoil_sensory.csv — the long-format file the R script reads (keep it in the script’s folder).
- R built-in: the script loads oliveoil from the pls package with data(); the two R files are its two tables exported as CSV.
Setup
In MinutePlot:
- Workbench → PLS → paste oliveoil_minuteplot.csv → Preview data → tick first column is sample names (the sample column) → response column yellow (Y); Acidity, Peroxide, K232, K270, DK are the predictors (X) → Confirm → components 3, Scale variables ticked, cross-validation and permutation off → Run PLS regression.
In R:
- Install once:
install.packages(c("pls")); then runoliveoil_pls.Rtop to bottom (source it, or paste it into the console) with the R data file in the same folder. - R 4.5.2 and the package versions in the page header; each script prints the versions it runs under.
The analysis:
- PLS1 of yellow on Acidity, Peroxide, K232, K270 and DK, 3 components, predictors and response standardised (scale = TRUE on both sides); MinutePlot: NIPALS; R: pls::plsr(..., ncomp = 3, scale = TRUE) with the kernel algorithm -- identical for a single response.
- The two R tables: oliveoil_chemical.csv is X (the five predictors); oliveoil_sensory.csv supplies Y (its yellow column). MinutePlot takes one table, so oliveoil_minuteplot.csv holds the five predictors with yellow beside them -- the chemical file alone has no response and cannot reproduce this entry.
- Cross-validation and permutation are off for this comparison (they are resampling procedures, not deterministic fits). Component signs are arbitrary and aligned before comparison.
Side-by-side results
Variance explained per model size (%)
MinutePlot®
| Components | X variance (per component) | yellow R² (cumulative) |
|---|---|---|
| 1 | 57.625 | 46.51 |
| 2 | 17.762 | 52.77 |
| 3 | 19.914 | 53.32 |
R
| Components | X variance (per component) | yellow R² (cumulative) |
|---|---|---|
| 1 | 57.625 | 46.51 |
| 2 | 17.762 | 52.77 |
| 3 | 19.914 | 53.32 |
R values: verified in R 4.5.2 (see the verdict).
X loadings
MinutePlot®
| Variable | Comp 1 | Comp 2 | Comp 3 |
|---|---|---|---|
| Acidity | -0.3398 | -0.5773 | 0.6734 |
| Peroxide | -0.4631 | 0.5296 | -0.3136 |
| K232 | -0.5172 | 0.3670 | -0.3797 |
| K270 | -0.5215 | -0.4062 | -0.3047 |
| DK | -0.4127 | 0.4172 | 0.6582 |
R
| Variable | Comp 1 | Comp 2 | Comp 3 |
|---|---|---|---|
| Acidity | -0.3398 | -0.5773 | 0.6734 |
| Peroxide | -0.4631 | 0.5296 | -0.3136 |
| K232 | -0.5172 | 0.3670 | -0.3797 |
| K270 | -0.5215 | -0.4062 | -0.3047 |
| DK | -0.4127 | 0.4172 | 0.6582 |
R values: verified in R 4.5.2 (see the verdict).
Regression coefficients, 3 components (MinutePlot: per original unit of X; R’s pls::coef with scale = TRUE: per SD of X -- MinutePlot × SD(X) is the same quantity)
MinutePlot®
| Variable | Per unit of X | Per SD of X |
|---|---|---|
| Acidity | -32.5568 | -5.7485 |
| Peroxide | -0.1849 | -0.6187 |
| K232 | -17.5985 | -4.3773 |
| K270 | -339.3870 | -8.0460 |
| DK | 789.6069 | 1.7656 |
R
| Variable | Per unit of X | Per SD of X |
|---|---|---|
| Acidity | -32.5569 | -5.7485 |
| Peroxide | -0.1850 | -0.6187 |
| K232 | -17.5985 | -4.3773 |
| K270 | -339.3888 | -8.0460 |
| DK | 789.6003 | 1.7656 |
R values: verified in R 4.5.2 (see the verdict).
Verdict
X variance per component (57.625 / 17.762 / 19.914 %), cumulative R² (0.4651 / 0.5277 / 0.5332) and all fifteen loadings agree with R’s printed pls::plsr output; the coefficients agree once R’s per-SD convention is applied (MinutePlot × SD(X) = R’s values to 4 dp).
R script
oliveoil_pls.R — each script loads its data, prints its versions and the R-side tables shown above, in page order; no plotting.
R values verified in R 4.5.2 (emmeans 2.0.4, multcomp 1.4-32, multcompView 0.1-12, ez 4.5.0, Hmisc 5.3.0, pls 2.9.0, drc 3.0-1, car 3.1-5) on 16–17 September 2026.