This function fits an Orthogonal Projections to Latent Structures (OPLS) model to the provided x (predictor) and y (response) data.
Arguments
- x
A data.frame or tibble containing the x-data (predictors).
- y
A data.frame or tibble containing the y-data (responses).
- scale
A character string indicating the scaling method for the data ("center" or "pareto").
- crossval
An integer representing the number of cross-validation groups.
- permutation
An integer representing the number of permutations for the permutation test.
Value
A list containing the following components:
- x_scores
A matrix of x-scores (the projections of the x-data onto the predictive components).
- x_loadings
A matrix of x-loadings (the weights of the original x-variables on the predictive components).
- x_weights
A matrix of x-weights (the weights used to calculate the x-scores).
- orthoScores
A matrix of orthogonal scores (the projections of the x-data onto the orthogonal components).
- orthoLoadings
A matrix of orthogonal loadings (the weights of the original x-variables on the orthogonal components).
- orthoWeights
A matrix of orthogonal weights (the weights used to calculate the orthogonal scores).
- y_weights
A matrix of y-weights (the weights used to calculate the y-scores).
- y_orthoWeights
A matrix of orthogonal y-weights (the weights used to calculate the orthogonal y-scores).
- y_scores
A matrix of y-scores (the projections of the y-data onto the predictive components).
Details
OPLS is a supervised modeling technique used to find the multidimensional direction in the x-space that explains the maximum multidimensional variance in the y-space. It separates the systematic variation in x into two parts: one that is linearly related to y (predictive components) and one that is statistically uncorrelated to the response variable y (orthogonal components).