Provides a summary of the results of a multivariate data analysis.
Usage
# S4 method for class 'MultivariateSummary'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)
# S4 method for class 'CA'
summary(
object,
...,
axes = c(1, 2),
margin = 1,
active = TRUE,
sup = TRUE,
rank = NULL
)
# S4 method for class 'PCA'
summary(
object,
...,
axes = c(1, 2),
margin = 1,
active = TRUE,
sup = TRUE,
rank = NULL
)
Arguments
- x
A
MultivariateSummary
object.- row.names
A
character
vector giving the row names for the data frame, orNULL
.- optional
A
logical
scalar: should the names of the variables in the data frame be checked? IfFALSE
then the names of the variables in the data frame are checked to ensure that they are syntactically valid variable names and are not duplicated.- ...
Currently not used.
- object
- axes
A length-two
numeric
vector giving the dimensions to be summarized.- margin
A length-one
numeric
vector giving the subscript which the data will be summarized:1
indicates individuals/rows (the default),2
indicates variables/columns.- active
A
logical
scalar: should the active observations be summarized?- sup
A
logical
scalar: should the supplementary observations be summarized?- rank
An
integer
value specifying the maximal number of components to be kept in the results. Deprecated, useaxes
instead.
Examples
## Data from Lebart et al. 2006, p. 170-172
data("colours")
## Compute correspondence analysis
X <- ca(colours)
## Rows summary
summary(X, margin = 1)
#> # Correspondence Analysis (CA)
#>
#> ## Eigenvalues
#>
#> | | eigenvalues | variance | cumulative |
#> | :- | ----------: | -------: | ---------: |
#> | F1 | 0.209 | 89.373 | 89.373 |
#> | F2 | 0.022 | 9.515 | 98.888 |
#> | F3 | 0.003 | 1.112 | 100 |
#>
#> ## Active rows
#>
#> | | inertia | F1_coord | F1_contrib | F1_cos2 | F2_coord | F2_contrib | F2_cos2 |
#> | :------- | ------: | -------: | ---------: | ------: | -------: | ---------: | ------: |
#> | marron | 250.487 | -0.492 | 43.116 | 0.967 | -0.088 | 13.042 | 0.031 |
#> | noisette | 83.321 | -0.213 | 3.401 | 0.542 | 0.167 | 19.804 | 0.336 |
#> | vert | 148.785 | 0.162 | 1.355 | 0.176 | 0.339 | 55.91 | 0.773 |
#> | bleu | 306.566 | 0.547 | 52.128 | 0.977 | -0.083 | 11.244 | 0.022 |
## Columns summary
summary(X, margin = 2)
#> # Correspondence Analysis (CA)
#>
#> ## Eigenvalues
#>
#> | | eigenvalues | variance | cumulative |
#> | :- | ----------: | -------: | ---------: |
#> | F1 | 0.209 | 89.373 | 89.373 |
#> | F2 | 0.022 | 9.515 | 98.888 |
#> | F3 | 0.003 | 1.112 | 100 |
#>
#> ## Active columns
#>
#> | | inertia | F1_coord | F1_contrib | F1_cos2 | F2_coord | F2_contrib | F2_cos2 |
#> | :------ | ------: | -------: | ---------: | ------: | -------: | ---------: | ------: |
#> | brun | 303.812 | -0.505 | 22.246 | 0.838 | -0.215 | 37.877 | 0.152 |
#> | chatain | 25.428 | -0.148 | 5.086 | 0.864 | 0.033 | 2.319 | 0.042 |
#> | roux | 125.862 | -0.13 | 0.964 | 0.133 | 0.32 | 55.131 | 0.812 |
#> | blond | 702.91 | 0.835 | 71.704 | 0.993 | -0.07 | 4.673 | 0.007 |