Q2 and R2X of PCA

I find some packages to plot PCA graphics.But I find some packages can calculate Q2 and R2X.I don't know what they are meanings.for example prcomp only provides variable,ropls can provides R2X.
This is my R codes

library(ropls)
library(ggord)
library(ggplot2)
library(dplyr)
library(ggrepel)
data(foods)
foods<-foods%>%select_if(~!any(is.na(.)))
foodMN <- as.matrix(foods[, colnames(foods) != "Country"])
rownames(foodMN) <- foods[, "Country"]

PCA1<-prcomp(foodMN,scale. = T)
ggord(PCA1,foods$Country,coord_fix=F,ellipse = F,
      arrow=0, vec_ext =0,txt=NULL)+
  labs(title = "PCA-all")+
  geom_label_repel(aes(label = rownames(foodMN)),show.legend = F)+
  theme(plot.title = element_text(size=18,hjust=0.5))
PCA2<-opls(foodMN)

There are references here:
https://bioconductor.org/packages/devel/bioc/vignettes/ropls/inst/doc/ropls-vignette.html

Thanks your reply.
I use the same data with SIMICA to plot PCA.R2X is PC,R2X(cum) is sum(PC).But Q2 I don't know how it works.There is not Q2 value with ropls package.

From the page linked above:

The ropls package

The ropls R package implements the PCA, PLS(-DA) and OPLS(-DA) approaches with the original, NIPALS-based, versions of the algorithms (Wold, Sjostrom, and Eriksson 2001; Trygg and Wold 2002). It includes the R2 and Q2 quality metrics (Eriksson et al. 2001; Tenenhaus 1998), the permutation diagnostics (Szymanska et al. 2012), the computation of the VIP values (Wold, Sjostrom, and Eriksson 2001), the score and orthogonal distances to detect outliers (Hubert, Rousseeuw, and Vanden Branden 2005), as well as many graphics (scores, loadings, predictions, diagnostics, outliers, etc).

the Q2 metric is one of the metrics provided by the ropls package. However, to understand how Q2 is calculated and used, it's probably better to ask on Cross Validated, the Stack Exchange site about statistics. Here's a related post from there: What is the Q² value for each component of a PCA

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.