N-Way Partial Least Squares Modelling of Multi-Way Data

Creation and selection of N-way Partial Least Squares (NPLS) models. Selection of the optimal number of components can be done using ncrossreg(). NPLS was originally described by Rasmus Bro, see .


NPLStoolbox

R-CMD-check Codecov testcoverage CRAN/METACRAN Version GitHubRelease GitHub R packageversion

Overview

The NPLStoolbox allows researchers to use the N-way Partial Least Squares method for their multi-way data.

  • ncrossreg() allows the user to identify the appropriate number of NPLS components for their data.
  • triPLS1() allows the user to create an NPLS model.
  • npred() allows the user to predict y for new data.

This package also comes with two example datasets:

  • Cornejo2025: a clinical observational cohort study of 39 transgender persons starting gender-affirming hormone therapy, containing longitudinally measured tongue microbiome, salivary microbiome, salivary cytokine, salivary biochemistry, and circulatory hormone levels (doi TBD).
  • Jakobsen2025: an observational cohort of 169 mother-infant dyads investigating the effect of maternal obesity on human milk and the infant gut microbiome https://doi.org/10.21203/rs.3.rs-6244750/v1.

Documentation

A basic introduction to the package using the example dataset is given in vignette("Introduction").

This vignette and all function documentation can be found here.

Installation

The NPLStoolbox package can be installed from CRAN using:

install.packages("NPLStoolbox")

Development version

You can install the development version of NPLStoolbox from GitHub with:

# install.packages("pak")
pak::pak("GRvanderPloeg/NPLStoolbox")

Usage

library(parafac4microbiome)
library(NPLStoolbox)
set.seed(123)

# Process one of the data cubes from Cornejo2025
processedTongue = processDataCube(Cornejo2025$Tongue_microbiome, sparsityThreshold=0.5, considerGroups=TRUE, groupVariable="GenderID", centerMode=1, scaleMode=2)

# Prepare Y: binarized gender identity
Y = as.numeric(as.factor(Cornejo2025$Tongue_microbiome$mode1$GenderID))
Ycnt = Y - mean(Y)

# Make a one-component NPLS model
model = triPLS1(processedTongue$data, Ycnt, 1)

Getting help

If you encounter an unexpected error or a clear bug, please file an issue with a minimal reproducible example here on Github. For questions or other types of feedback, feel free to send an email.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("NPLStoolbox")

1.1.1 by Geert Roelof van der Ploeg, 2 months ago


https://github.com/GRvanderPloeg/NPLStoolbox, https://grvanderploeg.com/NPLStoolbox/


Report a bug at https://github.com/GRvanderPloeg/NPLStoolbox/issues


Browse source code at https://github.com/cran/NPLStoolbox


Authors: Geert Roelof van der Ploeg [aut, cre] (ORCID: , Johan Westerhuis [ctb] , Anna Heintz-Buschart [ctb] (ORCID: , Age Smilde [ctb] , University of Amsterdam [cph, fnd]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports dplyr, parafac4microbiome, pracma, rTensor, stats

Suggests ggpattern, ggplot2, ggpubr, knitr, readr, rmarkdown, scales, stringr, testthat, tidyr


Suggested by CMTFtoolbox.


See at CRAN