Skip to contents

OTAPlot creates the graphs for a PCA analysis from ExPosition. Note: Still Under Development.

OTAplotInference graph4epPCA Create the inferential graphs from results of a PCA run with the package InPosition.

graph4epPCA graph4epPCA run a principal component analysis (with the ExPosition package) and generates the standard graphs and tables. Note that the parameters data, scale, center, DESIGN, make_design_nominal, k are passed to the ExPosition package unchanged except for scale which defaults now to 'SS1'.

Usage

OTAplot(
  resPCA,
  data,
  DESIGN = NULL,
  make_design_nominal = TRUE,
  k = 0,
  graphs = 12,
  printGraphs = FALSE,
  col4I = NULL,
  col4J = NULL,
  biplot = FALSE,
  rotation = FALSE,
  nfactor4rotation = "Kaiser",
  show.TI = FALSE,
  show.CI = TRUE,
  mean.cex = 3,
  mean.textcex = 3,
  display.labels.ind = FALSE,
  display.labels.var = TRUE,
  display.points.mean = TRUE,
  mean.constraints = NULL,
  scale.mean.constraints = 1.5,
  max.n4bar = 40,
  max.n4heat = 50,
  title.size.heatmap = 20,
  save2pptx = FALSE,
  title4pptx = "PCA Results"
)

OTAplotInference(
  resPCA,
  data,
  DESIGN = NULL,
  make_design_nominal = TRUE,
  k = 0,
  graphs = 12,
  printGraphs = FALSE,
  col4I = NULL,
  col4J = NULL,
  biplot = FALSE,
  rotation = FALSE,
  nfactor4rotation = "Kaiser",
  niter.boot = 100,
  niter.perm = 100,
  save2pptx = FALSE,
  title4pptx = "PCA Inference Results"
)

graph4epPCA(
  data,
  scale = TRUE,
  center = TRUE,
  DESIGN = NULL,
  make_design_nominal = TRUE,
  k = 0,
  graphs = 12,
  printGraphs = FALSE,
  col4I = NULL,
  col4J = NULL,
  biplot = FALSE,
  rotation = FALSE,
  nfactor4rotation = "Kaiser",
  inferences = FALSE,
  save2pptx = "",
  title4pptx = "PCA Results"
)

Arguments

resPCA

Output from InPosition::epCA.inference.battery

data

A data frame or a matrix with numerical data suitable for a PCA. Passed to ExPosition::epPCA.

DESIGN

Default: NULL. A design vector (could be factor or character) or (Boolean) matrix used to assigne oobservations to groups. Passed to ExPosition::epPCA.

make_design_nominal

if TRUE (Default) transform the vector from DESIGN into a Boolean matrix. Passed to ExPosition::epPCA.

k

number of factor to keep; when equql to 0 (Default), all factors are kept. Passed to ExPosition::epPCA.

graphs

do we want graphs? Current Default is 12 which indicates that the graphs are generated for the first 2 components. Note that current version is creating output only for the first two components,

printGraphs

(Default: FALSE) do we want to print the graphics as .png?

col4I

a color vector for plotting the observations (if NULL Default) use colors from ExPosition::epPCA.

col4J

a color vector for plotting the variables (if NULL Default) use colors from ExPosition::epPCA.

biplot

De we want to create biplots (Default: FALSE)?

rotation

Do we want to rotate (with varimax) the variables (Default: FALSE)

nfactor4rotation

number of factors to keep for the rotation, could be a number (note if the number is too big nfactor4rotation will default to 2), or a name (currently only 'Kaiser' which is the default). When 'Kaiser' is chosen, we keep only the components with an eigenvalue larger than average (when scaled == 'SS1' this is the familiar rule: "keep only the components with eigenvalue larger than 1").

show.TI

whether to plot the tolerance intervals or not. Default: FALSE

show.CI

whether to plot the confidence intervals or not. Default: TRUE

mean.cex

the size of the dots of the means. Default: 3

mean.textcex

the size of the texts of the means. Default: 3

display.labels.ind

If TRUE, the labels of observations will be printed. Default: FALSE.

display.labels.var

If TRUE, the labels of variables will be printed. Default: TRUE.

display.points.mean

If TRUE, the mean factor scores will be plotted. Default: TRUE.

mean.constraints

A list of the constraints (that include minx, miny, maxx, and maxy) The constraints of the figure that only includes the means. This constraints will be used if only.mean = TRUE. Default: NULL

scale.mean.constraints

A value used to scale the constraints (by multiplication). This function is used to adjust the constraints when the confidence or the tolerance intervals are outside of the figure. Default: 1.5

max.n4bar

When the number of bars exceed this value, the labels will be hidden. Default: 40.

max.n4heat

When the number of row/columns of a heatmap exceed this value, the labels will be hidden. Default: 50.

title.size.heatmap

the size of the title of the heatmaps. Default: 20.

save2pptx

Default: '' Not yet implemented,

title4pptx

PARAM_DESCRIPTION, Default: 'PCA Results'. Not yet implemented,.

niter.boot

(default = 100) How many iteration for the bootstrap for the mean of the DESIGN variable.

niter.perm

(default = 100) How many iteration for the permutation test for the eigenvalues.

scale

scale (i.e., normalize) the columns of data. Default: TRUE. Values could be TRUE, FALSE, 'Z', 'SS1'. TRUE defaults to SS1. Passed to ExPosition::epPCA.

center

Default: TRUE. do we center the columns of data Passed to ExPosition::epPCA.

inferences

Run inferences from InPosition Remains to be done, Default is FALSE.

Value

A list made of two lists

A list made of two lists

A list made of two lists

Details

Work in Progress

Work in Progress

Work in Progress

Author

Herve Abdi

Hervé Abdi

Examples

if (FALSE) {
if(interactive()){
 # Example from data4PCCAR
 data("sixBeers12Descriptors10Judges", package = 'data4PCCAR')
 df <- sixBeers12Descriptors10Judges$ratingsIntensity
 res4graph <- graph4epPCA(data = df, scale = FALSE)
 }
}
if (FALSE) {
if(interactive()){
 # Example from data4PCCAR
 data("sixBeers12Descriptors10Judges", package = 'data4PCCAR')
 df <- sixBeers12Descriptors10Judges$ratingsIntensity
 res4graph <- graph4epPCA(data = df, scale = FALSE)
 }
}
if (FALSE) {
if(interactive()){
 # Example from data4PCCAR
 data("sixBeers12Descriptors10Judges", package = 'data4PCCAR')
 df <- sixBeers12Descriptors10Judges$ratingsIntensity
 res4graph <- graph4epPCA(data = df, scale = FALSE)
 }
}