ssq: Calculate SSQ (accuracy) of biplot representation for...

View source: R/calc.r

ssqR Documentation

Calculate SSQ (accuracy) of biplot representation for elements and constructs.

Description

Each construct and element are vectors in a multidimensional space. When reducing the representation to a lower dimensional space, a loss of information (sum-of-squares) will usually occur. The output of the function shows the proportion of sum-of-squares (SSQ) explained for the elements (constructs) and the amount explained by each principal component. This allows to assess which elements (construct) are represented how well in the current representation. Also it shows how much of the total variation is explained.

Usage

ssq(
  x,
  along = 2,
  center = 1,
  normalize = 0,
  g = 0,
  h = 1 - g,
  col.active = NA,
  col.passive = NA,
  ...
)

Arguments

x

repgrid object.

along

Numeric. Table of sum-of-squares (SSQ) for 1=constructs, 2=elements (default). Note that currently these calculations only make sense for biplot representations with g=1 and h=1 respectively.

center

Numeric. The type of centering to be performed. 0= no centering, 1= row mean centering (construct), 2= column mean centering (elements), 3= double-centering (construct and element means), 4= midpoint centering of rows (constructs). The default is 1 (row centering).

normalize

A numeric value indicating along what direction (rows, columns) to normalize by standard deviations. ⁠0 = none, 1= rows, 2 = columns⁠ (default is 0).

g

Power of the singular value matrix assigned to the left singular vectors, i.e. the constructs.

h

Power of the singular value matrix assigned to the right singular vectors, i.e. the elements.

col.active

Columns (elements) that are no supplementary points, i.e. they are used in the SVD to find principal components. default is to use all elements.

col.passive

Columns (elements) that are supplementary points, i.e. they are NOT used in the SVD but projected into the component space afterwards. They do not determine the solution. Default is NA, i.e. no elements are set supplementary.

Value

A list containing three elements:

  • ssq.table: dataframe with sum-of-squares explained for element/construct by each dimension

  • ssq.table.cumsum: dataframe with cumulated sum-of-squares explained for element/construct number of dimensions

  • ssq.total: total sum-of-squares after pre-transforming grid matrix

Note

TODO: if g or h is not equal to 1 the SSQ does not measure accuracy of representation as currently the ssq of each point are set in contrast with the pre-transformed matrix.

Examples


# explained sum-of-squares for elements
ssq(bell2010)

# explained sum-of-squares for constructs
ssq(bell2010, along = 1)

# save results
s <- ssq(bell2010)

# printing options
print(s)
print(s, digits = 4)
print(s, dim = 3)
print(s, cumulated = FALSE)

# access results
names(s)
s$ssq.table
s$ssq.table.cumsum
s$ssq.total


markheckmann/OpenRepGrid documentation built on April 14, 2024, 8:15 a.m.