MakeCIEllipses: 'MakeCIEllipses'. Add Confidence interval ellipses to a...

View source: R/ggEllipses.R

MakeCIEllipsesR Documentation

MakeCIEllipses. Add Confidence interval ellipses to a CA-like plots.

Description

MakeCIEllipses: Create the Confidence Intervals (CI) ellipses for plots for the I or J sets of a CA or STATIS type of analysis The results of MakeCIEllipses should be added to BaseMap created, for example, by the function CreateBaseMap()

Usage

MakeCIEllipses(
  data,
  axis1 = 1,
  axis2 = 2,
  names.of.factors = paste0("Dimension ", c(axis1, axis2)),
  col = NULL,
  centers = NULL,
  line.size = 1,
  line.type = 1,
  alpha.ellipse = 0.3,
  alpha.line = 0.5,
  p.level = 0.95
)

Arguments

data

A cube of bootstraped factor scores should be an I Items * K factors * nIter array (e.g. as given by epCA.inference.battery) with: I number of items, K number of factors (at least 2) nIter number of Bootstrap samples

axis1

(default = 1): the horizontal axis

axis2

(default = 2): the vertical axise

names.of.factors

(default is paste0('Dimension ',c(axis1,axis2)), names of the factors, needs to be a 2-components vector. if NULL name.of.factors is dimnames(data)[2]. This argument is Needed to avoid conflict when plotting these names need to be the same as the names of the data used to make the BaseMap plot (i.e., Fi/Fj/Fij).

col

(default = NULL) a string or a vector of strings with color names if NULL use prettyGraphs scheme with prettyGraphs::prettyGraphsColorSelection

centers

(default = NULL): if NULL centers the ellipses on their barycenter to center on another canters (i.e., item factor scores) provide an I * K data frame or matrix

line.size

(default = 1) thickness of the line for the ellipses

line.type

(default = 1) the type of line for the ellipses

alpha.ellipse

(default = .3) alpha value (i.e., transparency) for the ellipses

alpha.line

(default = .5): alpha value (i.e., transparency) for the lines

p.level

(default = .95), p-value for the CI

Value

LeGraph.elli the ellipses to be added to the main plot [e.g., as created by CreateBaseMap()].

Author(s)

Herve Abdi

Examples

## Not run: 
Fij = rbind(Fi,Fj) # Fi and Fj being factor scores say from ExPosition
ABaseMap     <- CreateBaseMap(Fij)
# Boot_I is a Bootstrap cube for the I-set
GraphElli <- MakeCIEllipses(Boot_I)
ABaseMap + GraphElli # plot the I Set CI ellipses

## End(Not run)

HerveAbdi/PTCA4CATA documentation built on July 17, 2022, 5:41 a.m.