Title: | Matrix Correlation Coefficients |
---|---|
Description: | Computation and visualization of matrix correlation coefficients. The main method is the Similarity of Matrices Index, while various related measures like r1, r2, r3, r4, Yanai's GCD, RV, RV2, adjusted RV, Rozeboom's linear correlation and Coxhead's coefficient are included for comparison and flexibility. |
Authors: | Kristian Hovde Liland |
Maintainer: | Kristian Hovde Liland <[email protected]> |
License: | GPL-2 |
Version: | 0.10.0 |
Built: | 2024-11-06 06:38:01 UTC |
Source: | CRAN |
Compare all correlation measures in the package (or a subset)
allCorrelations( X1, X2, ncomp1, ncomp2, methods = c("SMI", "RV", "RV2", "RVadj", "PSI", "r1", "r2", "r3", "r4", "GCD"), digits = 3, plot = TRUE, xlab = "", ylab = "", ... )
allCorrelations( X1, X2, ncomp1, ncomp2, methods = c("SMI", "RV", "RV2", "RVadj", "PSI", "r1", "r2", "r3", "r4", "GCD"), digits = 3, plot = TRUE, xlab = "", ylab = "", ... )
X1 |
first |
X2 |
second |
ncomp1 |
maximum number of subspace components from the first |
ncomp2 |
maximum number of subspace components from the second |
methods |
|
digits |
number of digits for numerical output. |
plot |
logical indicating if plotting should be performed (default = TRUE). |
xlab |
optional x axis label. |
ylab |
optional y axis label. |
... |
additional arguments for |
For each of the coefficients a single scalar is computed to describe the similarity between the two input matrices. Note that some methods requires setting one or two numbers of components.
A single value measuring the similarity of two matrices.
Kristian Hovde Liland
SMI: Indahl, U.G.; Næs, T.; Liland, K.H.; 2018. A similarity index for comparing coupled matrices. Journal of Chemometrics; e3049.
RV: Robert, P.; Escoufier, Y. (1976). "A Unifying Tool for Linear Multivariate Statistical Methods: The RV-Coefficient". Applied Statistics 25 (3): 257-265.
RV2: Smilde, AK; Kiers, HA; Bijlsma, S; Rubingh, CM; van Erk, MJ (2009). "Matrix correlations for high-dimensional data: the modified RV-coefficient". Bioinformatics 25(3): 401-5.
Adjusted RV: Mayer, CD; Lorent, J; Horgan, GW. (2011). "Exploratory analysis of multiple omics datasets using the adjusted RV coefficient". Stat Appl Genet Mol Biol. 10(14).
PSI: Sibson, R; 1978. "Studies in the Robustness of Multidimensional Scaling: Procrustes Statistics". Journal of the Royal Statistical Society. Series B (Methodological), Vol. 40, No. 2, pp. 234-238.
Rozeboom: Rozeboom, WW; 1965. "Linear correlations between sets of variables". Psychometrika 30(1): 57-71.
Coxhead: Coxhead, P; 1974. "Measuring the releationship between two sets of variables". British Journal of Mathematical and Statistical Psychology 27: 205-212.
SMI
, RV
(RV2/RVadj), r1
(r2/r3/r4/GCD).
X1 <- scale( matrix( rnorm(100*300), 100,300), scale = FALSE) usv <- svd(X1) # Remove third principal component from X1 to produce X2 X2 <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3]) allCorrelations(X1,X2, ncomp1 = 5,ncomp2 = 5)
X1 <- scale( matrix( rnorm(100*300), 100,300), scale = FALSE) usv <- svd(X1) # Remove third principal component from X1 to produce X2 X2 <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3]) allCorrelations(X1,X2, ncomp1 = 5,ncomp2 = 5)
Measurements from sensory analysis (professional tasting) on a number of candy products obtained by sensory labs. The two labs and the associated data sets are parts of a larger study described in Tomic et al. (2010),
data(candy)
data(candy)
Two matrices of dimension 18 x 6.
Tomic, O., Luciano, G., Nilsen, A., Hyldig, G., Lorensen, K., Næs, T. (2010). Analysing sensory panel performance in a proficiency test using the PanelCheck software. European Food Research and Technology. 230. 3, 497-511
Permutation test for squared Pearson correlation between to vectors of samples.
cor.test_eq(x, y, B = 10000)
cor.test_eq(x, y, B = 10000)
x |
first |
y |
second |
B |
integer number of permutations, default = 10000. |
This is a convenience function combining SMI
and significant
for the
special case of vector vs vector comparisons. The nullhypothesis is that the correlation
between the vectors is +/-1, while significance signifies a deviance toward 0.
A value indicating if the two input vectors are signficantly different.
Kristian Hovde Liland
Similarity of Matrices Index - Ulf Geir Indahl, Tormod Næs, Kristian Hovde Liland
plot.SMI
(print.SMI/summary.SMI), RV
(RV2/RVadj), r1
(r2/r3/r4/GCD),
allCorrelations
(matrix correlation comparison), PCAcv (cross-validated PCA)
.
a <- (1:5) + rnorm(5) b <- (1:5) + rnorm(5) cor.test_eq(a,b)
a <- (1:5) + rnorm(5) b <- (1:5) + rnorm(5) cor.test_eq(a,b)
Coxhead's coefficient
Coxhead(X1, X2, weighting = c("sqrt", "min"))
Coxhead(X1, X2, weighting = c("sqrt", "min"))
X1 |
first |
X2 |
second |
weighting |
|
A single value measuring the similarity of two matrices. For diagnostic purposes it is accompanied by an attribute "canonical.correlation".
Coxhead, P; 1974. "Measuring the releationship between two sets of variables". British Journal of Mathematical and Statistical Psychology 27: 205-212.
SMI
, RV
(RV2/RVadj), Rozeboom
, r1
(r2/r3/r4/GCD).
X <- matrix(rnorm(100*13),nrow=100) X1 <- X[, 1:5] # Random normal X2 <- X[, 6:12] # Random normal X2[,1] <- X2[,1] + X[,5] # Overlap in one variable Coxhead(X1, X2)
X <- matrix(rnorm(100*13),nrow=100) X1 <- X[, 1:5] # Random normal X2 <- X[, 6:12] # Random normal X2[,1] <- X2[,1] + X[,5] # Overlap in one variable Coxhead(X1, X2)
Computation and visualization of matrix correlation coefficients. The main method is the Similarity of Matrices Index, while various related measures like r1, r2, r3, r4, Yanai's GCD, RV, RV2, adjusted RV, Rozeboom's linear correlation and Coxhead's coefficient are included for comparison and flexibility.
SMI: Indahl, U.G.; Næs, T.; Liland, K.H.; 2018. A similarity index for comparing coupled matrices. Journal of Chemometrics; e3049.
RV: Robert, P.; Escoufier, Y. (1976). "A Unifying Tool for Linear Multivariate Statistical Methods: The RV-Coefficient". Applied Statistics 25 (3): 257-265.
RV2: Smilde, AK; Kiers, HA; Bijlsma, S; Rubingh, CM; van Erk, MJ (2009). "Matrix correlations for high-dimensional data: the modified RV-coefficient". Bioinformatics 25(3): 401-5.
Adjusted RV: Mayer, CD; Lorent, J; Horgan, GW. (2011). "Exploratory analysis of multiple omics datasets using the adjusted RV coefficient". Stat Appl Genet Mol Biol. 10(14).
PSI: Sibson, R; 1978. "Studies in the Robustness of Multidimensional Scaling: Procrustes Statistics". Journal of the Royal Statistical Society. Series B (Methodological), Vol. 40, No. 2, pp. 234-238.
Rozeboom: Rozeboom, WW; 1965. "Linear correlations between sets of variables". Psychometrika 30(1): 57-71.
Coxhead: Coxhead, P; 1974. "Measuring the releationship between two sets of variables". British Journal of Mathematical and Statistical Psychology 27: 205-212.
SMI
, plot.SMI
(print.SMI/summary.SMI), RV
(RV2/RVadj), r1
(r2/r3/r4/GCD), Rozeboom
, Coxhead
, allCorrelations
(matrix correlation comparison).
PRESS values for PCA as implemented by Eigenvector and described by Bro et al. (2008).
PCAcv(X, ncomp)
PCAcv(X, ncomp)
X |
|
ncomp |
|
For each number of components predicted residual sum of squares are calculated based on leave-one-out cross-validation. The implementation ensures no over-fitting or information bleeding.
A vector of PRESS-values.
Kristian Hovde Liland
R. Bro, K. Kjeldahl, A.K. Smilde, H.A.L. Kiers, Cross-validation of component models: A critical look at current methods. Anal Bioanal Chem (2008) 390: 1241-1251.
plot.SMI
(print.SMI/summary.SMI), RV
(RV2/RVadj), r1
(r2/r3/r4/GCD), allCorrelations
(matrix correlation comparison).
X1 <- scale( matrix( rnorm(100*300), 100,300), scale = FALSE) PCAcv(X1,10)
X1 <- scale( matrix( rnorm(100*300), 100,300), scale = FALSE) PCAcv(X1,10)
Imputation of missing data, NA, using Principal Component Analysis with iterative refitting and mean value updates. The chosen number of components and convergence parameters (iterations and tolerance) influence the precision of the imputation.
PCAimpute(X, ncomp, center = TRUE, max_iter = 20, tol = 10^-5)
PCAimpute(X, ncomp, center = TRUE, max_iter = 20, tol = 10^-5)
X |
|
ncomp |
|
center |
|
max_iter |
|
tol |
|
Final singular value decomposition, imputed X
matrix and
convergence metrics (sequence of sum of squared change and number of iterations).
X <- matrix(rnorm(12),3,4) X[c(2,6,10)] <- NA PCAimpute(X, 3)
X <- matrix(rnorm(12),3,4) X[c(2,6,10)] <- NA PCAimpute(X, 3)
Plotting, printing and summary functions for SMI, plus significance testing.
## S3 method for class 'SMI' plot( x, y = NULL, x1lab = attr(x, "mat.names")[[1]], x2lab = attr(x, "mat.names")[[2]], main = "SMI", signif = 0.05, xlim = c(-(pq[1] + 1)/2, (pq[2] + 1)/2), ylim = c(0.5, (sum(pq) + 3)/2), B = 10000, cex = 1, cex.sym = 1, frame = NULL, frame.col = "red", frame.lwd = 2, replicates = NULL, ... ) ## S3 method for class 'SMI' print(x, ...) ## S3 method for class 'SMI' summary(object, ...) is.signif(x, signif = 0.05, B = 10000, ...)
## S3 method for class 'SMI' plot( x, y = NULL, x1lab = attr(x, "mat.names")[[1]], x2lab = attr(x, "mat.names")[[2]], main = "SMI", signif = 0.05, xlim = c(-(pq[1] + 1)/2, (pq[2] + 1)/2), ylim = c(0.5, (sum(pq) + 3)/2), B = 10000, cex = 1, cex.sym = 1, frame = NULL, frame.col = "red", frame.lwd = 2, replicates = NULL, ... ) ## S3 method for class 'SMI' print(x, ...) ## S3 method for class 'SMI' summary(object, ...) is.signif(x, signif = 0.05, B = 10000, ...)
x |
object of class |
y |
not used. |
x1lab |
optional label for first matrix. |
x2lab |
optional label for second matrix. |
main |
optional heading (default = SMI). |
signif |
significance level for testing (default=0.05). |
xlim |
optional plotting limits. |
ylim |
optional plotting limits. |
B |
number of permutations (for significant, default=10000). |
cex |
optional text scaling (default = 1) |
cex.sym |
optional scaling for significance symbols (default = 1) |
frame |
two element integer vector indicating framed components. |
frame.col |
color for framed components. |
frame.lwd |
line width for framed components. |
replicates |
vector of replicates for significance testing. |
... |
additional arguments for |
object |
object of class |
For plotting a diamonad plot is used. High SMI values are light and low SMI values are dark. If orthogonal projections have been used for calculating SMIs, significance symbols are included in the plot unless signif=NULL.
plot
silently returns NULL. print
and summary
return the printed matrix.
Kristian Hovde Liland
Similarity of Matrices Index - Ulf G. Indahl, Tormod Næs, Kristian Hovde Liland
SMI
, PCAcv (cross-validated PCA)
.
X1 <- scale( matrix( rnorm(100*300), 100,300), scale = FALSE) usv <- svd(X1) X2 <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3]) smi <- SMI(X1,X2,5,5) plot(smi, B = 1000) # default B = 10000 print(smi) summary(smi) is.signif(smi, B = 1000) # default B = 10000
X1 <- scale( matrix( rnorm(100*300), 100,300), scale = FALSE) usv <- svd(X1) X2 <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3]) smi <- SMI(X1,X2,5,5) plot(smi, B = 1000) # default B = 10000 print(smi) summary(smi) is.signif(smi, B = 1000) # default B = 10000
An index based on the RV coefficient with Procrustes rotation.
PSI(X1, X2, center = TRUE)
PSI(X1, X2, center = TRUE)
X1 |
first |
X2 |
second |
center |
|
The Procrustes Similarity Index
Sibson, R; 1978. "Studies in the Robustness of Multidimensional Scaling: Procrustes Statistics". Journal of the Royal Statistical Society. Series B (Methodological), Vol. 40, No. 2, pp. 234-238.
X1 <- scale( matrix( rnorm(100*300), 100,300), scale = FALSE) usv <- svd(X1) X2 <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3]) PSI(X1,X2)
X1 <- scale( matrix( rnorm(100*300), 100,300), scale = FALSE) usv <- svd(X1) X2 <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3]) PSI(X1,X2)
Matrix similarity as described by Ramsey et al. (1984).
r1(X1, X2, center = TRUE, impute = FALSE) r2( X1, X2, center = TRUE, impute = FALSE, impute_par = list(max_iter = 20, tol = 10^-5) ) r3( X1, X2, center = TRUE, impute = FALSE, impute_par = list(max_iter = 20, tol = 10^-5) ) r4( X1, X2, center = TRUE, impute = FALSE, impute_par = list(max_iter = 20, tol = 10^-5) ) GCD( X1, X2, ncomp1 = min(dim(X1)), ncomp2 = min(dim(X2)), center = TRUE, impute = FALSE, impute_par = list(max_iter = 20, tol = 10^-5) )
r1(X1, X2, center = TRUE, impute = FALSE) r2( X1, X2, center = TRUE, impute = FALSE, impute_par = list(max_iter = 20, tol = 10^-5) ) r3( X1, X2, center = TRUE, impute = FALSE, impute_par = list(max_iter = 20, tol = 10^-5) ) r4( X1, X2, center = TRUE, impute = FALSE, impute_par = list(max_iter = 20, tol = 10^-5) ) GCD( X1, X2, ncomp1 = min(dim(X1)), ncomp2 = min(dim(X2)), center = TRUE, impute = FALSE, impute_par = list(max_iter = 20, tol = 10^-5) )
X1 |
first |
X2 |
second |
center |
|
impute |
|
impute_par |
named |
ncomp1 |
(GCD) number of subspace components from the first |
ncomp2 |
(GCD) number of subspace components from the second |
Details can be found in Ramsey's paper:
r1: inner product correlation
r2: orientation-independent inner product correlation
r3: spectra-independent inner product correlations (including orientation)
r4: Spectra-Independent inner product Correlations
GCD: Yanai's Generalized Coefficient of Determination (GCD) Measure. To reproduce the original GCD, use all components. When X1
and X2
are dummy variables, GCD is proportional with Pillai's criterion: tr(W^-1(B+W)).
A single value measuring the similarity of two matrices.
Kristian Hovde Liland
Ramsay, JO; Berg, JT; Styan, GPH; 1984. "Matrix Correlation". Psychometrica 49(3): 403-423.
SMI
, RV
(RV2/RVadj), Rozeboom
, Coxhead
,
allCorrelations
(matrix correlation comparison), PCAcv (cross-validated PCA)
, PCAimpute (PCA based imputation)
.
X1 <- matrix(rnorm(100*300),100,300) usv <- svd(X1) X2 <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3]) r1(X1,X2) r2(X1,X2) r3(X1,X2) r4(X1,X2) GCD(X1,X2) GCD(X1,X2, 5,5) # Missing data X1[c(1, 50, 400, 900)] <- NA X2[c(10, 200, 450, 1200)] <- NA r1(X1,X2, impute = TRUE) r2(X1,X2, impute = TRUE) r3(X1,X2, impute = TRUE) r4(X1,X2, impute = TRUE) GCD(X1,X2, impute = TRUE) GCD(X1,X2, 5,5, impute = TRUE)
X1 <- matrix(rnorm(100*300),100,300) usv <- svd(X1) X2 <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3]) r1(X1,X2) r2(X1,X2) r3(X1,X2) r4(X1,X2) GCD(X1,X2) GCD(X1,X2, 5,5) # Missing data X1[c(1, 50, 400, 900)] <- NA X2[c(10, 200, 450, 1200)] <- NA r1(X1,X2, impute = TRUE) r2(X1,X2, impute = TRUE) r3(X1,X2, impute = TRUE) r4(X1,X2, impute = TRUE) GCD(X1,X2, impute = TRUE) GCD(X1,X2, 5,5, impute = TRUE)
Rozeboom's squared vector correlation
Rozeboom(X1, X2) sqveccor(X1, X2)
Rozeboom(X1, X2) sqveccor(X1, X2)
X1 |
first |
X2 |
second |
A single value measuring the similarity of two matrices. For diagnostic purposes it is accompanied by an attribute "canonical.correlation".
Korbinian Strimmer and Kristian Hovde Liland
Rozeboom, WW; 1965. "Linear correlations between sets of variables". Psychometrika 30(1): 57-71.
SMI
, RV
(RV2/RVadj), Coxhead
, r1
(r2/r3/r4/GCD).
X <- matrix(rnorm(100*13),nrow=100) X1 <- X[, 1:5] # Random normal X2 <- X[, 6:12] # Random normal X2[,1] <- X2[,1] + X[,5] # Overlap in one variable Rozeboom(X1, X2)
X <- matrix(rnorm(100*13),nrow=100) X1 <- X[, 1:5] # Random normal X2 <- X[, 6:12] # Random normal X2[,1] <- X2[,1] + X[,5] # Overlap in one variable Rozeboom(X1, X2)
Three different RV coefficients: RV, RV2 and adusted RV.
RV(X1, X2, center = TRUE, impute = FALSE) RV2(X1, X2, center = TRUE, impute = FALSE) RVadjMaye(X1, X2, center = TRUE) RVadjGhaziri(X1, X2, center = TRUE) RVadj(X1, X2, version = c("Maye", "Ghaziri"), center = TRUE)
RV(X1, X2, center = TRUE, impute = FALSE) RV2(X1, X2, center = TRUE, impute = FALSE) RVadjMaye(X1, X2, center = TRUE) RVadjGhaziri(X1, X2, center = TRUE) RVadj(X1, X2, version = c("Maye", "Ghaziri"), center = TRUE)
X1 |
first |
X2 |
second |
center |
|
impute |
|
version |
Which version of RV adjusted to apply: "Maye" (default) or "Ghaziri"
RV adjusted is run using the |
For each of the four coefficients a single scalar is computed to describe the similarity between the two input matrices.
A single value measuring the similarity of two matrices.
Kristian Hovde Liland, Benjamin Leutner (RV2)
RV: Robert, P.; Escoufier, Y. (1976). "A Unifying Tool for Linear Multivariate Statistical Methods: The RV-Coefficient". Applied Statistics 25 (3): 257-265.
RV2: Smilde, AK; Kiers, HA; Bijlsma, S; Rubingh, CM; van Erk, MJ (2009). "Matrix correlations for high-dimensional data: the modified RV-coefficient". Bioinformatics 25(3): 401-5.
Adjusted RV: Maye, CD; Lorent, J; Horgan, GW. (2011). "Exploratory analysis of multiple omics datasets using the adjusted RV coefficient". Stat Appl Genet Mol Biol. 10(14).
Adjusted RV: El Ghaziri, A; Qannari, E.M. (2015) "Measures of association between two datasets; Application to sensory data", Food Quality and Preference 40 (A): 116-124.
SMI
, r1
(r2/r3/r4/GCD), Rozeboom
, Coxhead
,
allCorrelations
(matrix correlation comparison), PCAcv (cross-validated PCA)
, PCAimpute (PCA based imputation)
.
X1 <- matrix(rnorm(100*300),100,300) usv <- svd(X1) X2 <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3]) RV(X1,X2) RV2(X1,X2) RVadj(X1,X2) # Missing data X1[c(1, 50, 400, 900)] <- NA X2[c(10, 200, 450, 1200)] <- NA RV(X1,X2, impute = TRUE) RV2(X1,X2, impute = TRUE)
X1 <- matrix(rnorm(100*300),100,300) usv <- svd(X1) X2 <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3]) RV(X1,X2) RV2(X1,X2) RVadj(X1,X2) # Missing data X1[c(1, 50, 400, 900)] <- NA X2[c(10, 200, 450, 1200)] <- NA RV(X1,X2, impute = TRUE) RV2(X1,X2, impute = TRUE)
Permutation based hypothesis testing for SMI. The nullhypothesis is that a linear function of one matrix subspace is included in the subspace of another matrix.
significant(smi, B = 10000, replicates = NULL)
significant(smi, B = 10000, replicates = NULL)
smi |
|
B |
integer number of permutations, default = 10000. |
replicates |
integer vector of replicates. |
For each combination of components significance is estimated by sampling from a null distribution
of no similarity, i.e. when the rows of one matrix is permuted B times and corresponding SMI values are
computed. If the vector replicates
is included, replicates will be kept together through
permutations.
A matrix containing P-values for all combinations of components.
Kristian Hovde Liland
Similarity of Matrices Index - Ulf G. Indahl, Tormod Næs Kristian Hovde Liland
plot.SMI
(print.SMI/summary.SMI), RV
(RV2/RVadj), r1
(r2/r3/r4/GCD), allCorrelations
(matrix correlation comparison).
X1 <- scale( matrix( rnorm(100*300), 100,300), scale = FALSE) usv <- svd(X1) X2 <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3]) (smi <- SMI(X1,X2,5,5)) significant(smi, B = 1000) # default B = 10000
X1 <- scale( matrix( rnorm(100*300), 100,300), scale = FALSE) usv <- svd(X1) X2 <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3]) (smi <- SMI(X1,X2,5,5)) significant(smi, B = 1000) # default B = 10000
A similarity index for comparing coupled data matrices.
SMI( X1, X2, ncomp1 = Rank(X1) - 1, ncomp2 = Rank(X2) - 1, projection = "Orthogonal", Scores1 = NULL, Scores2 = NULL, impute = FALSE, impute_par = list(max_iter = 20, tol = 10^-5) )
SMI( X1, X2, ncomp1 = Rank(X1) - 1, ncomp2 = Rank(X2) - 1, projection = "Orthogonal", Scores1 = NULL, Scores2 = NULL, impute = FALSE, impute_par = list(max_iter = 20, tol = 10^-5) )
X1 |
first |
X2 |
second |
ncomp1 |
maximum number of subspace components from the first |
ncomp2 |
maximum number of subspace components from the second |
projection |
type of projection to apply, defaults to "Orthogonal", alternatively "Procrustes". |
Scores1 |
user supplied score- |
Scores2 |
user supplied score- |
impute |
|
impute_par |
named |
A two-step process starts with extraction of stable subspaces using Principal Component Analysis or some other method yielding two orthonormal bases. These bases are compared using Orthogonal Projection (OP / ordinary least squares) or Procrustes Rotation (PR). The result is a similarity measure that can be adjusted to various data sets and contexts and which includes explorative plotting and permutation based testing of matrix subspace equality.
A matrix containing all combinations of components. Its class is "SMI" associated with print, plot, summary methods.
Kristian Hovde Liland
Ulf Geir Indahl, Tormod Næs, Kristian Hovde Liland; 2018. A similarity index for comparing coupled matrices. Journal of Chemometrics; e3049.
plot.SMI
(print.SMI/summary.SMI), RV
(RV2/RVadj), r1
(r2/r3/r4/GCD), Rozeboom
, Coxhead
,
allCorrelations
(matrix correlation comparison), PCAcv (cross-validated PCA)
, PCAimpute (PCA based imputation)
.
# Simulation X1 <- scale( matrix( rnorm(100*300), 100,300), scale = FALSE) usv <- svd(X1) X2 <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3]) (smi <- SMI(X1,X2,5,5)) plot(smi, B = 1000 ) # default B = 10000 # Sensory analysis data(candy) plot( SMI(candy$Panel1, candy$Panel2, 3,3, projection = "Procrustes"), frame = c(2,2), B = 1000, x1lab = "Panel1", x2lab = "Panel2" ) # default B = 10000 # Missing data (100 missing completely at random points each) X1[sort(round(runif(100)*29999+1))] <- NA X2[sort(round(runif(100)*29999+1))] <- NA (smi <- SMI(X1,X2,5,5, impute = TRUE))
# Simulation X1 <- scale( matrix( rnorm(100*300), 100,300), scale = FALSE) usv <- svd(X1) X2 <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3]) (smi <- SMI(X1,X2,5,5)) plot(smi, B = 1000 ) # default B = 10000 # Sensory analysis data(candy) plot( SMI(candy$Panel1, candy$Panel2, 3,3, projection = "Procrustes"), frame = c(2,2), B = 1000, x1lab = "Panel1", x2lab = "Panel2" ) # default B = 10000 # Missing data (100 missing completely at random points each) X1[sort(round(runif(100)*29999+1))] <- NA X2[sort(round(runif(100)*29999+1))] <- NA (smi <- SMI(X1,X2,5,5, impute = TRUE))