# Chapter 6 Partial Least Square Correlation Analysis

Data Table: Partial Least Square Correlation (PLSC) method compares the information in two data tables on the same set of observations.

Goal:

• Find the relationship between variables from the two tables.(Shared information between tables)

• Find the commonality: by finding the maximum covariance between latent variables (one for each table) obtained as linear combinations of the original variables.

Note: These discriminant variables are also used to assign the original observations or “new” observations to originally defined categories.

Key ideas

1. Perform SVD on correlation matrix between the variables of the two tables

2. The latent variables are obtained by projecting the original matrices onto their respective saliences. Lx = X * P
Ly = Y * Q

3. Saliences Loadings (Column Factor Scores) are separate for the two tables. Fx = P * delta Fy = Q * delta

4. Lx1 and Ly2 are orthogonal to each other.

Interpretation

``````1. The latent variables, which describe the observations, are required to
“explain” the largest portion of the covariance between the two tables.

2. The original variables are described by their saliences.``````

## 6.1 Datasets:

Survey of Autobiographical Memory + Object-Spatial ImageryQuestionnaire (SAM + OSIQ)

Rows: The observation is common across the two tables. 144 Participants asked to rate the extent to which a particular item applied to their memory in general, using a 5-point Likert scale.

SAM Columns: 26 quantitative variables

``````Episodic Memory: 8 questions (Memory for personal experiences)
Semantic Memory : 6 questions (Memory for general knowledge and facts)
Spatial Memory : 6 questions (Memory testing how well one can navigate)
Prospective Memory : 6 questions (How clearly one can picture future events)``````

OSIQ Columns: 30 quantitative variables.

``````Object imagery scale : 15 questions(processing of colorful, pictorial, and
high-resolution images of individual objects)

Spatial imagery scale : 15 questions (processing of schematic images, spatial
relations amongst objects, and spatial
transformations)``````

## 6.2 Looking at the Data Pattern

### 6.2.1 Correlation Plot:

Plotting the correlation between SAM and OSIQ

Episodic Memory and Memory for future is positively correlated with the participants preference for object and vegatively correlated with spatial imagery. This shows that participants tend to remember and imagine color and shapes of objects when they are refering to their memory for personal experiences than the location or position of the objects.

There is a positive correlation observed between Spatial memory(P) and Spatial imagery(So), which is very much expected.

``````# Compute the covariance matrix
XY.cor <- cor(data1,data2)

corrplot(XY.cor, method = "color", tl.cex = .5, tl.col = "royalblue",
addCoef.col = "black", number.digits = 0, number.cex = .4,
cl.pos = 'b', cl.cex = .3,
col = colorRampPalette(c("darkred", "white","midnightblue"))(20)) `````` ## 6.3 PLSC Analysis

``pls.res <- tepPLS(data1,data2, DESIGN = data.design, make_design_nominal = TRUE, graphs = FALSE)``

### 6.3.1 Scree Plot

The scree plot shows a weird pattern because the null hypothesis is that there is no correlation between the tables (Null = 0) Hence eigenvalues greater than zero become significant.

The results of the permutation test gives us the eigenvalues.

``````# no.of eigenvalues
nL <- min(ncol(data1),ncol(data2))

resPerm4PLSC <- perm4PLSC(data1, # First Data matrix
data2, # Second Data matrix
nIter = 1000 # How mny iterations
)
print(resPerm4PLSC)``````
``````## ------------------------------------------------------------------------------
##  Results of Permutation Test for PLSC of X'*Y = R
##  for Omnibus Inertia and Eigenvalues
## ------------------------------------------------------------------------------
## \$ fixedInertia      the Inertia of Matrix X
## \$ fixedEigenvalues  an L*1 vector of the eigenvalues of X
## \$ pOmnibus          the probablity associated to the Inertia
## \$ pEigenvalues      an L* 1 matrix of p for the eigenvalues of X
## \$ permInertia       vector of the permuted Inertia of X
## \$ permEigenvalues   matrix of the permuted eigenvalues of X
## ------------------------------------------------------------------------------``````
``````my.scree <-PlotScree(ev = pls.res\$TExPosition.Data\$eigs,
title = 'PLSC- Scree Plot',
p.ev = resPerm4PLSC\$pEigenvalues,
plotKaiser = TRUE,
color4Kaiser = ggplot2::alpha('darkorchid4', .5),
)`````` ``````nL <- min(ncol(data1),ncol(data2))

my.scree``````
``##   0 10 20 30 40``

### 6.3.2 Latent Variable Pairs

#### 6.3.2.1 Looking at the First Pair of Latent variables (Lx1, Ly1)

Separates the High and normal memory groups well. The latent variables of the two data share a high covariance.

``````#uniquecol <- unique(pls.res\$Plotting.Data\$fii.col)
#grpcol <- uniquecol
#rownames(grpcol) <- data.design.vec[rownames(uniquecol),]

# ploting the first latent variable of data1(X) and first latent variables of data2(Y). We are tryingto see if these two latent variables are similar or not.

# first pair of latent variables:

latvar.1 <- cbind(pls.res\$TExPosition.Data\$lx[,1],
pls.res\$TExPosition.Data\$ly[,1])
colnames(latvar.1) <- c("Lx 1", "Ly 1")

# compute means
lv.1.group <- getMeans(latvar.1,data.design.vec)

col4Means <- recode(rownames(lv.1.group),
High = 'darkred',
Norm = 'orange2',
)
names(col4Means) <- rownames(lv.1.group)

# compute bootstrap - for confidence intervals
lv.1.group.boot <- Boot4Mean(latvar.1, data.design.vec)
colnames(lv.1.group.boot\$BootCube) <- c("Lx 1", "Ly 1")

# plotiing the factor Maps

plot.lv1 <- createFactorMap(latvar.1,
col.points = col4row,
col.labels = col4row,
alpha.points = 0.2
)

plot1.mean <- createFactorMap(lv.1.group,
col.points = col4Means,
col.labels = col4Means,
cex = 4,
pch = 17,
alpha.points = 0.8)

plot1.meanCI <- MakeCIEllipses(lv.1.group.boot\$BootCube[,c(1:2),], # get the first two components
col = col4Means[rownames(lv.1.group.boot\$BootCube)],
names.of.factors = c("Lx 1", "Ly 1")
)

plot1 <- plot.lv1\$zeMap_background + plot.lv1\$zeMap_dots + plot1.mean\$zeMap_dots + plot1.mean\$zeMap_text + plot1.meanCI
plot1`````` #### 6.3.2.2 Looking at the Second Pair of Latent Variables ### 6.3.3 Column Factor scores of the 1st component of table1 and table2

SAM Component 1: Explained by both Episodic memory and Future Memory Component 2: Spatial Memory mostly explains

OSIQ Component 1: Explained by Object Imagery Component 2: Explained by Spatial Imagery

``````#fi:column factor scores for table 1 (P) or Loadings of table 1
Fi<- pls.res\$TExPosition.Data\$fi
Fj<- pls.res\$TExPosition.Data\$fj

axis1 = 1,
axis2 = 2,
display.points = TRUE,
display.labels = TRUE,
col.points = col4Var,
col.labels = col4Var,
pch = 20,
cex = 6,
text.cex = 5,
)

label4map <- createxyLabels.gen(x_axis = 1, y_axis = 2,
lambda = pls.res\$TExPosition.Data\$eigs,
tau = pls.res\$TExPosition.Data\$t
)

p.plot`````` ``````q.loadings <- createFactorMap(Fj,
axis1 = 1,
axis2 = 2,
display.points = TRUE,
display.labels = TRUE,
col.points = col4Var2,
col.labels = col4Var2,
pch = 20,
cex = 6,
text.cex = 5,
)

label4map <- createxyLabels.gen(x_axis = 1, y_axis = 2,
lambda = pls.res\$TExPosition.Data\$eigs,
tau = pls.res\$TExPosition.Data\$t
)

q.plot`````` ``````grid.barplot.weights <- gridExtra::grid.arrange(as.grob(plot_P.data1),
as.grob(plot_Q.data2),
as.grob(plot_P2.data1),
as.grob(plot_Q2.data2),

ncol = 2,nrow = 2 ,
gp=gpar(fontsize=18,font=3))
)`````` ``grid.barplot.weights``
``````## TableGrob (3 x 2) "arrange": 5 grobs
##   z     cells    name                 grob
## 1 1 (2-2,1-1) arrange       gtable[layout]
## 2 2 (2-2,2-2) arrange       gtable[layout]
## 3 3 (3-3,1-1) arrange       gtable[layout]
## 4 4 (3-3,2-2) arrange       gtable[layout]
## 5 5 (1-1,1-2) arrange text[GRID.text.9631]``````

Inference Bootstrap

Looking into what the resBootPLSC is giving us.

``````## ------------------------------------------------------------------------------
##  Bootstraped Factor Scores (BFS) and Bootstrap Ratios  (BR)
##  for the I and J-sets of a PLSC (obtained from multinomial resampling of X & Y)
## ------------------------------------------------------------------------------
## \$ bootstrapBrick.i          an I*L*nIter Brick of BFSs  for the I-Set
## \$ bootRatios.i              an I*L matrix of BRs for the I-Set
## \$ bootRatiosSignificant.i   an I*L logical matrix for significance of the I-Set
## \$ bootstrapBrick.j          a  J*L*nIter Brick of BFSs  for the J-Set
## \$ bootRatios.j              a  J*L matrix of BRs for the J-Set
## \$ bootRatiosSignificant.j   a  J*L logical matrix for significance of the J-Set
## ------------------------------------------------------------------------------``````

### 6.3.5 Contribution and Bootstrap ratio Bar Plots  ## 6.4 Conclusion

Latent Variables Pairs

Pair 1: Separates the two memory groups well. The latent variables of the two data share a high covariance.

Pair 2: Does not really provide more information with the current groupings.

Column Factor Scores : SAM

Dim 1: Explained by both Episodic memory and Future Memory

Dim 2: Spatial Memory

Column Factor Scores : OSIQ

Dim 1: Represents Object Imagery

Dim 2: Represents Spatial Imagery

Interpretation:

Episodic Memory and Memory for Future is likely to be stronger for participants who have a preference towards Object Imagery and these participants are under the category of Higher AM.

The better the Spatial Memory of the participants the better is their ability to remember spatial relations amongst objects or space and loadings also reflect that these participants tend to have a prefeance for spatial imagery. These Participants however belong to the Normal AM group.