lpda.3D {lpda} | R Documentation |
Classification with lpda for 3way array data
Description
This function applies lpda methodology to classify individuals in two or more groups with original data (by applying lpda through the third dimension) or by applying lpda to the parafac scores.
Usage
lpda.3D(data, group, scale = FALSE, pfac = FALSE, nfac = 2,
nstart = 10, seed=2, f1 = NULL, f2 = NULL)
## S3 method for class 'lpda.3D'
print(x, ...)
Arguments
data |
Array containing data. Individuals in the first mode, variables in the second mode and third mode with time or similar. |
group |
Vector with the variable group. |
scale |
Logical indicating if it is required standardize data. |
pfac |
Logical indicating if Parafac Analysis is required |
nfac |
Number of factors for Parafac Analysis. |
nstart |
Number of random starts for multiway analysis. |
seed |
A single value to reproduce same results in multiway methods. |
f1 |
Vector with weights for individuals of the first group. If NULL they are equally weighted. |
f2 |
Vector with weights for individuals of the second group. If NULL they are equally weighted. |
x |
An object of class " |
... |
Other arguments passed. |
Value
lpda.3D
returns an object of class "lpda.3D
".
MOD |
When |
data |
Input array data |
group |
Input group vector |
pfac |
Input pfac argument |
The functions predict
and plot
can be used to obtain the predicted classes and a plot in two dimensions with the distances to the computed hyperplane for the two classes.
Author(s)
Maria Jose Nueda, mj.nueda@ua.es
References
Nueda MJ, GandÃa C, Molina MD (2022) LPDA: A new classification method based on linear programming. PLoS ONE 17(7): e0270403. <https://doi.org/10.1371/journal.pone.0270403>
See Also
Examples
### RNAseq is a 3-dimensional array
data(RNAseq)
group = as.factor(rep(c("G1","G2"), each = 10))
## Strategy 1
model3D = lpda.3D(RNAseq, group)
summary(model3D)
predict(model3D)
plot(model3D, mfrow=c(2,2))
## Strategy 2: with parafac
model3Ds2 = lpda.3D(RNAseq, group, pfac=TRUE, nfac=2)
model3Ds2$MOD$mod.pfac$Rsq
predict(model3Ds2)
summary(model3Ds2)
plot(model3Ds2, pfacscores=FALSE, main="Parafac Model", mfrow=c(1,1))
plot(model3Ds2, pfacscores=TRUE, cex=1.5, main="Parafac components")
legend("bottomright", levels(group), col=c(2,3), pch=20)