plot.SMI: Result functions for the Similarity of Matrices Index (SMI)

View source: R/SMI_results.R

plot.SMIR Documentation

Result functions for the Similarity of Matrices Index (SMI)

Description

Plotting, printing and summary functions for SMI, plus significance testing.

Usage

## 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, ...)

Arguments

x

object of class SMI.

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 plot.

object

object of class SMI.

Details

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.

Value

plot silently returns NULL. print and summary return the printed matrix.

Author(s)

Kristian Hovde Liland

References

Similarity of Matrices Index - Ulf G. Indahl, Tormod Næs, Kristian Hovde Liland

See Also

SMI, PCAcv (cross-validated PCA).

Examples

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


khliland/MatrixCorrelation documentation built on Feb. 5, 2023, 3:13 a.m.