GraphDistatisAll: This function combines the functionality of...

View source: R/GraphDistatisAll.R

GraphDistatisAllR Documentation

This function combines the functionality of GraphDistatisCompromise, GraphDistatisPartial, GraphDistatisBoot, and GraphDistatisRv.

Description

This function produces 4 plots: (1) a compromise plot, (2) a partial factor scores plot, (3) a bootstrap confidence intervals plot, and (4) an Rv map.

Usage

GraphDistatisAll(
  FS,
  PartialFS,
  FBoot,
  RvFS,
  axis1 = 1,
  axis2 = 2,
  constraints = NULL,
  item.colors = NULL,
  participant.colors = NULL,
  ZeTitleBase = NULL,
  nude = FALSE,
  Ctr = NULL,
  RvCtr = NULL,
  color.by.observations = TRUE,
  lines = TRUE,
  lwd = 3.5,
  ellipses = TRUE,
  fill = TRUE,
  fill.alpha = 0.27,
  percentage = 0.95
)

Arguments

FS

The factor scores of the observations ($res4Splus$Ffrom distatis)

PartialFS

The partial factor scores of the observations ($res4Splus$PartialF from distatis)

FBoot

is the bootstrapped factor scores array (FBoot obtained from BootFactorScores or BootFromCompromise)

RvFS

The factor scores of the distance matrices ($res4Cmat$G from distatis)

axis1

The dimension for the horizontal axis of the plots.

axis2

The dimension for the vertical axis of the plots.

constraints

constraints for the axes

item.colors

A I*1 matrix (with I = # observations) of color names for the observations. If NULL (default), prettyGraphs chooses.

participant.colors

A I*1 matrix (with I = # participants) of color names for the observations. If NULL (default), prettyGraphs chooses.

ZeTitleBase

General title for the plots.

nude

When nude is TRUE the labels for the observations are not plotted (useful when editing the graphs for publication).

Ctr

Contributions of each observation. If NULL (default), these are computed from FS

RvCtr

Contributions of each participant. If NULL (default), these are computed from RvFS

color.by.observations

if TRUE (default), the partial factor scores are colored by item.colors. When FALSE, participant.colors are used.

lines

If TRUE (default) then lines are drawn between the partial factor score of an observation and the compromise factor score of the observation.

lwd

Thickness of the line plotting the ellipse or hull.

ellipses

a boolean. When TRUE will plot ellipses (from car package). When FALSE (default) will plot peeled hulls (from prettyGraphs package).

fill

when TRUE, fill in the ellipse with color. Relevant for ellipses only.

fill.alpha

transparency index when filling in the ellipses. Relevant to ellipses only.

percentage

A value to determine the percent coverage of the bootstrap partial factor scores to provide ellipse or hull confidence intervals.

Value

constraints

A set of plot constraints that are returned.

item.colors

A set of colors for the observations are returned.

participant.colors

A set of colors for the participants are returned.

Author(s)

Derek Beaton and Herve Abdi

See Also

GraphDistatisAll GraphDistatisCompromise GraphDistatisPartial GraphDistatisBoot GraphDistatisRv distatis

Examples


# 1. Load the Sort data set from the SortingBeer example  (available from the DistatisR package)
data(SortingBeer)
# Provide an 8 beers by 10 assessors results of a sorting task
#-----------------------------------------------------------------------------
# 2. Create the set of distance matrices (one distance matrix per assessor)
#    (ues the function DistanceFromSort)
DistanceCube <- DistanceFromSort(Sort)

#-----------------------------------------------------------------------------
# 3. Call the DISTATIS routine with the cube of distance as parameter
testDistatis <- distatis(DistanceCube)
# The factor scores for the beers are in
# testDistatis$res4Splus$F
# the partial factor score for the beers for the assessors are in
#  testDistatis$res4Splus$PartialF
#
# 4. Get the bootstraped factor scores (with default 1000 iterations)
BootF <- BootFactorScores(testDistatis$res4Splus$PartialF)
#-----------------------------------------------------------------------------
# 5. Create the Graphics with GraphDistatisAll
#
GraphDistatisAll(testDistatis$res4Splus$F,testDistatis$res4Splus$PartialF,
	BootF,testDistatis$res4Cmat$G)


DistatisR documentation built on Dec. 5, 2022, 9:05 a.m.