CA Package
-
Upload
juancarlosespecializacion -
Category
Documents
-
view
220 -
download
0
Transcript of CA Package
-
8/10/2019 CA Package
1/22
Package ca
December 22, 2014
Version 0.55
Date 2014-03-09
Title Simple, Multiple and Joint Correspondence Analysis
Maintainer Oleg Nenadic
Depends R (>= 2.8.0)
Suggests rgl (>= 0.64-10)
Description A package for computation and visualization of simple, multiple and joint correspon-
dence analysis.
LazyLoad yes
LazyData yes
License GPL
URL http://www.carme-n.org/
Author Michael Greenacre [aut],
Oleg Nenadic [aut, cre],Michael Friendly [ctb]
Repository CRAN
Repository/R-Forge/Project ca0
Repository/R-Forge/Revision 6
Repository/R-Forge/DateTimeStamp 2014-03-11 14:21:56
Date/Publication 2014-07-06 17:44:54
NeedsCompilation no
R topics documented:
author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
ca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
iterate.mjca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
mjca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
pchlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
plot.ca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1
http://www.carme-n.org/http://www.carme-n.org/ -
8/10/2019 CA Package
2/22
2 ca
plot.mjca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
plot3d.ca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
print.ca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
print.mjca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
print.summary.ca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
print.summary.mjca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
smoke . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
summary.ca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
summary.mjca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
wg93 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Index 22
author Author dataset
Description
This data matrix contains the counts of the 26 letters of the alphabet (columns of matrix) for 12
different novels (rows of matrix). Each row contains letter counts in a sample of text from each
work, excluding proper nouns.
Usage
data("author")
Format
Data frame containing the 12 x 26 matrix.
Source
Larsen, W.A. and McGill, R., unpublished data collected in 1973.
ca Simple correspondence analysis
Description
Computation of simple correspondence analysis.
-
8/10/2019 CA Package
3/22
ca 3
Usage
ca(obj, ...)
## S3 method for class matrix
ca(obj, nd = NA, suprow = NA, supcol = NA,
subsetrow = NA, subsetcol = NA, ...)
## S3 method for class data.frame
ca(obj, ...)
## S3 method for class table
ca(obj, ...)
## S3 method for class xtabs
ca(obj, ...)
## S3 method for class formula
ca(formula, data, ...)
Arguments
obj,formula The function is generic, accepting various forms of the principal argument for
specifying a two-way frequency table. Currently accepted forms are matrices,
data frames (coerced to frequency tables), objects of class "xtabs"or "table"
and one-sided formulae of the form~ F1 + F2, whereF1and F2are factors.
nd Number of dimensions to be included in the output; if NA the maximum possible
dimensions are included.
suprow Indices of supplementary rows.
supcol Indices of supplementary columns.
subsetrow Row indices of subset.
subsetcol Column indices of subset.
data A data frame against which to preferentially resolve variables in theformula
... Other arguments passed to the ca.matrix method
Details
The functionca computes a simple correspondence analysis based on the singular value decompo-
sition.
The options suprowand supcolallow supplementary (passive) rows and columns to be specified.
Using the options subsetrowand/orsubsetcolresult in a subset CA being performed.
Value
sv Singular values
nd Dimenson of the solution
-
8/10/2019 CA Package
4/22
4 ca
rownames Row names
rowmass Row masses
rowdist Row chi-square distances to centroid
rowinertia Row inertias
rowcoord Row standard coordinates
rowsup Indices of row supplementary points
colnames Column names
colmass Column masses
coldist Column chi-square distances to centroid
colinertia Column inertias
colcoord Column standard coordinates
colsup Indices of column supplementary points
References
Nenadic, O. and Greenacre, M. (2007). Correspondence analysis in R, with two- and three-dimensional
graphics: The ca package. Journal of Statistical Software, 20 (3), http://www.jstatsoft.org/
v20/i03/
Greenacre, M. (2007). Correspondence Analysis in Practice. Second Edition. London: Chapman
& Hall / CRC.
Blasius, J. and Greenacre, M. J. (1994), Computation of correspondence analysis, in Correspon-
dence Analysis in the Social Sciences, pp. 53-75, London: Academic Press.
Greenacre, M.J. and Pardo, R. (2006), Subset correspondence analysis: visualizing relationships
among a selected set of response categories from a questionnaire survey. Sociological Methods and
Research,35, pp. 193-218.
See Also
svd,plot.ca,plot3d.ca,summary.ca,print.ca
Examples
data("author")
ca(author)
plot(ca(author))
# table method
haireye
-
8/10/2019 CA Package
5/22
iterate.mjca 5
iterate.mjca Updating a Burt matrix in Joint Correspondence Analysis
Description
Updating a Burt matrix in Joint Correspondence Analysis based on iteratively weighted least squares.
Usage
iterate.mjca(B, lev.n, nd = 2, maxit = 50, epsilon = 0.0001)
Arguments
B A Burt matrix.
lev.n The number of levels for each factor from the original response pattern matrix.
nd The required dimensionality of the solution.
maxit The maximum number of iterations.
epsilon A convergence criterion for the maximum absolute difference of updated values
compared to the previous values. The iteration is completed when all differences
are smaller thanepsilon.
Details
The function iterate.mjca computes the updated Burt matrix. This function is called from the
functionmjcawhen the option lambda="JCA", i.e. when a Joint Correspondence Analysis is per-
formed.
Value
B.star The updated Burt matrix
crit Vector of length 2 containing the number of iterations and epsilon
See Also
mjca
-
8/10/2019 CA Package
6/22
6 mjca
mjca Multiple and joint correspondence analysis
Description
Computation of multiple and joint correspondence analysis.
Usage
mjca(obj, nd = 2, lambda = c("adjusted", "indicator", "Burt", "JCA"),
supcol = NA, subsetcol = NA,
ps = ":", maxit = 50, epsilon = 0.0001)
Arguments
obj A response pattern matrix (data frame containing factors), or a frequency table(a table object)
nd Number of dimensions to be included in the output; if NA the maximum possible
dimensions are included.
lambda Gives the scaling method. Possible values include "indicator","Burt","adjusted"
and "JCA". Usinglambda = "JCA"results in a joint correspondence analysis
using iterative adjusment of the Burt matrix in the solution space.
supcol Indices of supplementary columns.
subsetcol Indices of subset categories.
ps Separator used for combining variable and category names.
maxit The maximum number of iterations (Joint Correspondence Analysis).
epsilon A convergence criterion (Joint Correspondence Analysis).
Details
The function mjcacomputes a multiple or joint correspondence analysis based on the eigenvalue
decomposition of the Burt matrix.
Value
sv Eigenvalues (lambda = "indicator") or singular values (lambda = "Burt",
"adjusted"or "JCA")
lambda Scaling method
inertia.e Percentages of explained inertia
inertia.t Total inertia
inertia.et Total percentage of explained inertia with thend-dimensional solution
levelnames Names of the factor/level combinations
levels.n Number of levels in each factor
-
8/10/2019 CA Package
7/22
mjca 7
nd User-specified dimensionality of the solution
nd.max Maximum possible dimensionality of the solution
rownames Row names
rowmass Row massesrowdist Row chi-square distances to centroid
rowinertia Row inertias
rowcoord Row standard coordinates
rowpcoord Row principal coordinates
rowctr Row contributions
rowcor Row squared correlations
colnames Column names
colmass Column masses
coldist Column chi-square distances to centroid
colinertia Column inertias
colcoord Column standard coordinates
colpcoord Column principal coordinates
colctr column contributions
colcor Column squared correlations
colsup Indices of column supplementary points (of the Burt and Indicator matrix)
subsetcol Indices of subset columns
Burt Burt matrix
Burt.upd The updated Burt matrix (JCA only)
subinertia Inertias of sub-matrices
JCA.iter Vector of length two containing the number of iterations and the epsilon (JCA
only)
call Return ofmatch.call
References
Nenadic, O. and Greenacre, M. (2007), Correspondence analysis in R, with two- and three-dimensional
graphics: The ca package. Journal of Statistical Software, 20 (3), http://www.jstatsoft.org/
v20/i03/
Nenadic, O. and Greenacre, M. (2007), Computation of Multiple Correspondence Analysis, with
Code in R, in Multiple Correspondence Analysis and Related Methods(eds. M. Greenacre and J.
Blasius), Boca Raton: Chapmann & Hall / CRC, pp. 523-551.
Greenacre, M.J. and Pardo, R. (2006), Subset correspondence analysis: visualizing relationshipsamong a selected set of response categories from a questionnaire survey. Sociological Methods and
Research,35, pp. 193-218.
See Also
eigen,plot.mjca,summary.mjca,print.mjca
http://www.jstatsoft.org/v20/i03/http://www.jstatsoft.org/v20/i03/http://www.jstatsoft.org/v20/i03/http://www.jstatsoft.org/v20/i03/ -
8/10/2019 CA Package
8/22
8 pchlist
Examples
data("wg93")
mjca(wg93[,1:4])
### Different approaches to multiple correspondence analysis:
# Multiple correspondence analysis based on the indicator matrix:
mjca(wg93[,1:4], lambda = "indicator")
# Multiple correspondence analysis based on the Burt matrix:
mjca(wg93[,1:4], lambda = "Burt")
# "Adjusted" multiple correspondence analysis (default setting):
mjca(wg93[,1:4], lambda = "adjusted")
# Joint correspondence analysis:
mjca(wg93[,1:4], lambda = "JCA")
### Subset analysis and supplementary variables:
# Subset analysis:
mjca(wg93[,1:4], subsetcol = (1:20)[-seq(3,18,5)])
# Supplementary variables:
mjca(wg93, supcol = 5:7)
# Combining supplementary variables and a subset analysis:
mjca(wg93, supcol = 5:7, subsetcol = (1:20)[-seq(3,18,5)])
# table input
data(UCBAdmissions)
mjca(UCBAdmissions)
plot(mjca(UCBAdmissions))
pchlist Listing the set of available symbols.
Description
A plot of the available symbols for use with the option pch.
Usage
pchlist()
Details
This function generates a numbered list of the plotting symbols available for use in the functions
plot.caand plot3d.ca.
-
8/10/2019 CA Package
9/22
plot.ca 9
See Also
plot.ca,plot3d.ca
Examplespchlist()
plot.ca Plotting 2D maps in correspondence analysis
Description
Graphical display of correspondence analysis results in two dimensions
Usage
## S3 method for class ca
plot(x, dim = c(1,2), map = "symmetric", what = c("all", "all"),
mass = c(FALSE, FALSE), contrib = c("none", "none"),
col = c("blue", "red"), pch = c(16, 21, 17, 24),
labels = c(2, 2), arrows = c(FALSE, FALSE),
lines = c(FALSE, FALSE), xlab = "_auto_", ylab = "_auto_",
col.lab = c("blue", "red"), ...)
Arguments
x Simple correspondence analysis object returned byca
dim Numerical vector of length 2 indicating the dimensions to plot on horizontal
and vertical axes respectively; default is first dimension horizontal and seconddimension vertical.
map Character string specifying the map type. Allowed options include
"symmetric"(default)
"rowprincipal"
"colprincipal"
"symbiplot"
"rowgab"
"colgab"
"rowgreen"
"colgreen"
what Vector of two character strings specifying the contents of the plot. First entry
sets the rows and the second entry the columns. Allowed values are
"all"(all available points, default)
"active"(only active points are displayed)
"passive"(only supplementary points are displayed)
"none"(no points are displayed)
The status (active or supplementary) of rows and columns is set in ca using the
optionssuprowand supcol.
-
8/10/2019 CA Package
10/22
10 plot.ca
mass Vector of two logicals specifying if the mass should be represented by the area
of the point symbols (first entry for rows, second one for columns)
contrib Vector of two character strings specifying if contributions (relative or absolute)
should be represented by different colour intensities. Available options are
"none"(contributions are not indicated in the plot).
"absolute"(absolute contributions are indicated by colour intensities).
"relative"(relative contributions are indicated by colour intensities).
If set to"absolute"or"relative", points with zero contribution are displayed
in white. The higher the contribution of a point, the closer the corresponding
colour to the one specified by the coloption.
col Vector of length 2 specifying the colours of row and column point symbols, by
default blue for rows and red for columns. Colours can be entered in hexadeci-
mal (e.g. "#FF0000"), rgb (e.g. rgb(1,0,0)) values or by R-name (e.g. "red").
pch Vector of length 4 giving the type of points to be used for row active and sup-
plementary, column active and supplementary points. Seepchlistfor a list of
symbols.
labels Vector of length two specifying if the plot should contain symbols only (0),
labels only (1) or both symbols and labels (2). Settinglabelsto 2results in the
symbols being plotted at the coordinates and the labels with an offset.
arrows Vector of two logicals specifying if the plot should contain points (FALSE, de-
fault) or arrows (TRUE). First value sets the rows and the second value sets the
columns.
lines Vector of two logicals specifying if the plot should join the points with lines
(FALSE, default) or arrows (TRUE). First value sets the rows and the second value
sets the columns.
xlab, ylab Labels for horizontal and vertical axes. The default,"_auto_"means that the
function auto-generates a label of the form Dimension X (xx.xx %
col.lab Vector of length 2 specifying the colours of row and column point labels
... Further arguments passed toplotand points.
Details
The functionplot.camakes a two-dimensional map of the object created by cawith respect to two
selected dimensions. By default the scaling option of the map is "symmetric", that is the so-called
symmetric map. In this map both the row and column points are scaled to have inertias (weighted
variances) equal to the principal inertia (eigenvalue or squared singular value) along the principal
axes, that is both rows and columns are in pricipal coordinates. Other options are as follows:
-"rowprincipal"or "colprincipal"- these are the so-called asymmetric maps, with either
rows in principal coordinates and columns in standard coordinates, or vice versa (also known
as row-metric-preserving or column-metric-preserving respectively). These maps are biplots;
-"symbiplot"- this scales both rows and columns to have variances equal to the singular
values (square roots of eigenvalues), which gives a symmetric biplot but does not preserve
row or column metrics;
-
8/10/2019 CA Package
11/22
plot.ca 11
-"rowgab" or "colgab" - these are asymmetric maps (see above) with rows (respectively,
columns) in principal coordinates and columns (respectively, rows) in standard coordinates
multiplied by the mass of the corresponding point. These are also biplots and were proposed
by Gabriel & Odoroff (1990);
-"rowgreen"or "colgreen" - these are similar to "rowgab" and "colgab" except that the
points in standard coordinates are multiplied by the square root of the corresponding masses,
giving reconstructions of the standardized residuals.
This function has options for sizing and shading the points. If the option massis TRUEfor a set of
points, the size of the point symbol is proportional to the relative frequency (mass) of each point.
If the option contrib is "absolute" or "relative" for a set of points, the colour intensity of
the point symbol is proportional to the absolute contribution of the points to the planar display or,
respectively, the quality of representation of the points in the display. To globally resize all the
points (and text labels), use par("cex"=)before the plot.
Value
In addition to the side effect of producing the plot, the function invisibly returns the coordinates
of the plotted points, a list of two components, with names rowsand cols. These can be used to
further annotate the plot using base R plotting functions.
References
Gabriel, K.R. and Odoroff, C. (1990). Biplots in biomedical research. Statistics in Medicine,9, pp.
469-485.
Greenacre, M.J. (1993)Correspondence Analysis in Practice. London: Academic Press.
Greenacre, M.J. (1993) Biplots in correspondence Analysis, Journal of Applied Statistics, 20, pp.
251 - 269.
See Alsoca,summary.ca,print.ca,plot3d.ca,pchlist
Examples
data("smoke")
# A two-dimensional map with standard settings
plot(ca(smoke))
# Mass for rows and columns represented by the size of the point symbols
plot(ca(smoke), mass = c(TRUE, TRUE))
# Displaying the column profiles only with masses represented by size of point
# symbols and relative contributions by colour intensity.
# Since the arguments are recycled it is sufficient to give only one argument
# for mass and contrib.
data("author")
plot(ca(author), what = c("none", "all"), mass = TRUE, contrib = "relative")
-
8/10/2019 CA Package
12/22
12 plot.mjca
plot.mjca Plotting 2D maps in multiple and joint correspondence analysis
Description
Graphical display of multiple and joint correspondence analysis results in two dimensions
Usage
## S3 method for class mjca
plot(x, dim = c(1,2), map = "symmetric", centroids = FALSE,
what = c("none", "all"), mass = c(FALSE, FALSE),
contrib = c("none", "none"), col = c("#000000", "#FF0000"),
pch = c(16, 1, 17, 24), labels = c(2, 2),
arrows = c(FALSE, FALSE), xlab = "_auto_", ylab = "_auto_", ...)
Arguments
x Multiple or joint correspondence analysis object returned bymjca
dim Numerical vector of length 2 indicating the dimensions to plot on horizontal
and vertical axes respectively; default is first dimension horizontal and second
dimension vertical.
map Character string specifying the map type. Allowed options include
"symmetric"(default)
"rowprincipal"
"colprincipal"
"symbiplot"
"rowgab""colgab"
"rowgreen"
"colgreen"
centroids Logical indicating if column centroids should be added to the plot
what Vector of two character strings specifying the contents of the plot. First entry
sets the rows and the second entry the columns. Allowed values are
"all"(all available points, default)
"active"(only active points are displayed)
"passive"(only supplementary points are displayed)
"none"(no points are displayed)
The status (active or supplementary) of columns is set in mjcausing the option
supcol.mass Vector of two logicals specifying if the mass should be represented by the area
of the point symbols (first entry for rows, second one for columns)
contrib Vector of two character strings specifying if contributions (relative or absolute)
should be represented by different colour intensities. Available options are
"none"(contributions are not indicated in the plot).
-
8/10/2019 CA Package
13/22
plot.mjca 13
"absolute"(absolute contributions are indicated by colour intensities).
"relative"(relative contributions are indicated by colour intensities).
If set to"absolute"or"relative", points with zero contribution are displayed
in white. The higher the contribution of a point, the closer the corresponding
colour to the one specified by the coloption.
col Vector of length 2 specifying the colours of row and column point symbols, by
default black for rows and red for columns. Colours can be entered in hexadeci-
mal (e.g. "#FF0000"), rgb (e.g. rgb(1,0,0)) values or by R-name (e.g. "red").
pch Vector of length 4 giving the type of points to be used for row active and sup-
plementary, column active and supplementary points. Seepchlistfor a list of
symbols.
labels Vector of length two specifying if the plot should contain symbols only (0),
labels only (1) or both symbols and labels (2). Settinglabelsto 2results in the
symbols being plotted at the coordinates and the labels with an offset.
arrows Vector of two logicals specifying if the plot should contain points (FALSE, de-
fault) or arrows (TRUE
). First value sets the rows and the second value sets thecolumns.
xlab, ylab Labels for horizontal and vertical axes. The default,"_auto_"means that the
function auto-generates a label of the form Dimension X (xx.xx %
... Further arguments passed toplotand points.
Details
The functionplot.mjcamakes a two-dimensional map of the object created by mjcawith respect
to two selected dimensions. By default the scaling option of the map is "symmetric", that is the
so-calledsymmetric map. In this map both the row and column points are scaled to have inertias
(weighted variances) equal to the principal inertia (eigenvalue) along the principal axes, that is both
rows and columns are in pricipal coordinates. Other options are as follows:
-"rowprincipal"or "colprincipal"- these are the so-called asymmetric maps, with either
rows in principal coordinates and columns in standard coordinates, or vice versa (also known
as row-metric-preserving or column-metric-preserving respectively). These maps are biplots;
-"symbiplot"- this scales both rows and columns to have variances equal to the singular
values (square roots of eigenvalues), which gives a symmetric biplot but does not preserve
row or column metrics;
-"rowgab" or "colgab" - these are asymmetric maps (see above) with rows (respectively,
columns) in principal coordinates and columns (respectively, rows) in standard coordinates
multiplied by the mass of the corresponding point. These are also biplots and were proposed
by Gabriel & Odoroff (1990);
-"rowgreen"or "colgreen" - these are similar to "rowgab" and "colgab" except that the
points in standard coordinates are multiplied by the square root of the corresponding masses,
giving reconstructions of the standardized residuals.
This function has options for sizing and shading the points. If the option massis TRUEfor a set of
points, the size of the point symbol is proportional to the relative frequency (mass) of each point.
-
8/10/2019 CA Package
14/22
14 plot3d.ca
If the option contrib is "absolute" or "relative" for a set of points, the colour intensity of
the point symbol is proportional to the absolute contribution of the points to the planar display or,
respectively, the quality of representation of the points in the display. To globally resize all the
points (and text labels), use par("cex"=)before the plot.
Value
In addition to the side effect of producing the plot, the function invisibly returns the coordinates
of the plotted points, a list of two components, with names rowsand cols. These can be used to
further annotate the plot using base R plotting functions.
References
Gabriel, K.R. and Odoroff, C. (1990). Biplots in biomedical research. Statistics in Medicine,9, pp.
469-485.
Greenacre, M.J. (1993)Correspondence Analysis in Practice. London: Academic Press.
Greenacre, M.J. (1993) Biplots in correspondence Analysis, Journal of Applied Statistics, 20, pp.
251 - 269.
See Also
mjca,summary.mjca,print.mjca,pchlist
Examples
data("wg93")
# A two-dimensional map with standard settings
plot(mjca(wg93[,1:4]))
plot3d.ca Plotting 3D maps in correspondence analysis
Description
Graphical display of correspondence analysis in three dimensions
Usage
## S3 method for class ca
plot3d(x, dim = c(1, 2, 3), map = "symmetric", what = c("all", "all"),
contrib = c("none", "none"), col = c("#6666FF","#FF6666"),
labcol = c("#0000FF", "#FF0000"), pch = c(16, 1, 18, 9),
labels = c(2, 2), sf = 0.00002, arrows = c(FALSE, FALSE), ...)
-
8/10/2019 CA Package
15/22
plot3d.ca 15
Arguments
x Simple correspondence analysis object returned by ca
dim Numerical vector of length 2 indicating the dimensions to plot
map Character string specifying the map type. Allowed options include"symmetric"(default)
"rowprincipal"
"colprincipal"
"symbiplot"
"rowgab"
"colgab"
"rowgreen"
"colgreen"
what Vector of two character strings specifying the contents of the plot. First entry
sets the rows and the second entry the columns. Allowed values are
"none"(no points are displayed)
"active"(only active points are displayed, default)"supplementary"(only supplementary points are displayed)
"all"(all available points)
The status (active or supplementary) is set in ca.
contrib Vector of two character strings specifying if contributions (relative or absolute)
should be indicated by different colour intensities. Available options are
"none"(contributions are not indicated in the plot).
"absolute"(absolute contributions are indicated by colour intensities).
"relative"(relative conrributions are indicated by colour intensities).
If set to"absolute"or"relative", points with zero contribution are displayed
in white. The higher the contribution of a point, the closer the corresponding
colour to the one specified by the coloption.
col Vector of length 2 specifying the colours of row and column profiles. Colourscan be entered in hexadecimal (e.g. "#FF0000"), rgb (e.g. rgb(1,0,0)) values
or by R-name (e.g. "red").
labcol Vector of length 2 specifying the colours of row and column labels.
pch Vector of length 2 giving the type of points to be used for rows and columns.
labels Vector of length two specifying if the plot should contain symbols only (0),
labels only (1) or both symbols and labels (2). Settinglabelsto 2results in the
symbols being plotted at the coordinates and the labels with an offset.
sf A scaling factor for the volume of the 3d primitives.
arrows Vector of two logicals specifying if the plot should contain points (FALSE, de-
fault) or arrows (TRUE). First value sets the rows and the second value sets the
columns.
... Further arguments passed to the rgl functions.
See Also
ca
-
8/10/2019 CA Package
16/22
16 print.mjca
print.ca Printing ca objects
Description
Printing method for correspondence analysis objects
Usage
## S3 method for class ca
print(x, ...)
Arguments
x Simple correspondence analysis object returned byca
... Further arguments are ignored
Details
The functionprint.cagives the basic statistics of the caobject. First the eigenvalues (that is, prin-
cipal inertias) and their percentages with respect to total inertia are printed. Then for the rows and
columns respectively, the following are printed: the masses, chi-square distances of the points to the
centroid (i.e., centroid of the active points), point inertias (for active points only) and principal co-
ordinates on the firstnd dimensions requested (default = 2 dimensions). The function summary.ca
gives more detailed results about the inertia contributions of each point on each principal axis.
For supplementary points, masses and inertias are not applicable.
See Also
ca
Examples
data("smoke")
print(ca(smoke))
print.mjca Printing mjca objects
Description
Printing method for multiple and joint correspondence analysis objects
Usage
## S3 method for class mjca
print(x, ...)
-
8/10/2019 CA Package
17/22
print.summary.ca 17
Arguments
x Multiple or joint correspondence analysis object returned bymjca
... Further arguments are ignored
Details
The function print.mjcagives the basic statistics of the mjca object. First the eigenvalues (that
is, principal inertias) and their percentages with respect to total inertia are printed. Then for the
rows and columns respectively, the following are printed: the masses, chi-square distances of the
points to the centroid (i.e., centroid of the active points), point inertias (for active points only) and
principal coordinates on the first nd dimensions requested (default = 2 dimensions). The function
summary.mjcagives more detailed results about the inertia contributions of each point on each
principal axis.
For supplementary points, masses and inertias are not applicable.
See Also
mjca
Examples
data("wg93")
print(mjca(wg93[,1:4]))
# equivalent to:
mjca(wg93[,1:4])
print.summary.ca Printing summeries of ca objects
Description
Printing method for summaries of correspondence analysis objects
Usage
## S3 method for class summary.ca
print(x, ...)
Arguments
x Summary of a simple correspondence analysis object returned bysummary.ca
... Further arguments are ignored
See Also
ca,summary.ca
-
8/10/2019 CA Package
18/22
18 smoke
print.summary.mjca Printing summeries of mjca objects
Description
Printing method for summaries of multiple and joint correspondence analysis objects
Usage
## S3 method for class summary.mjca
print(x, ...)
Arguments
x summary of a multiple or joint correspondence analysis object returned by summary.mjca
... Further arguments are ignored
See Also
mjca,summary.mjca
smoke Smoke dataset
Description
Artificial dataset in Greenacre (1984)
Usage
data(smoke)
Format
Table containing 5 rows (staff group) and 4 columns (smoking categories), giving the frequencies
of smoking categories in each staff group in a fictional organization.
References
Greenacre, M.J. (1984). Theory and Applications of Correspondence Analysis. London: Academic
Press.
-
8/10/2019 CA Package
19/22
summary.ca 19
summary.ca Summarizing simple correspondence analysis
Description
Textual output summarizing the results ofca, including a scree-plot of the principal inertias and
row and column contributions.
Usage
## S3 method for class ca
summary(object, scree = TRUE, ...)
Arguments
object Simple correspondence analysis object returned byca.
scree Logical flag specifying if a scree-plot should be included in the output.
... Further arguments (ignored)
Details
The function summary.ca gives the detailed numerical results of the ca function. All the eigenvalues
(principal inertias) are listed, their percentages with respect to total inertia, and a bar chart (alsoknown as a scree plot). Then for the set of rows and columns a table of results is given in a standard
format, where quantities are either multiplied by 1000 or expressed in permills (thousandths): the
mass of each point (x1000), the quality of display in the solution subspace ofnd dimensions, the
inertia of the point (in permills of the total inertia), and then for each dimension of the solution
the principal coordinate (x1000), the (relative) contribution COR of the principal axis to the point
inertia (x1000) and the (absolute) contribution CTR of the point to the inertia of the axis (in permills
of the principal inertia).
For supplementary points, masses, inertias and absolute contributions (CTR) are not applicable, but
the relative contributions (COR) are valid as well as their sum over the set of chosen nddimensions
(QLT).
Examples
data("smoke")
summary(ca(smoke))
-
8/10/2019 CA Package
20/22
20 summary.mjca
summary.mjca Summarizing multiple and joint correspondence analysis
Description
Textual output summarizing the results ofmjca,including a scree-plot of the principal inertias and
row and column contributions.
Usage
## S3 method for class mjca
summary(object, scree = TRUE, rows = FALSE, ...)
Arguments
object Multiple or joint correspondence analysis object returned bymjca.
scree Logical flag specifying if a scree-plot should be included in the output.
rows Logical specifing whether the results for the rows should be included in the
output (default =FALSE).
... Further arguments (ignored)
Details
The functionsummary.mjca
gives the detailed numerical results of the mjca
function. All theeigenvalues (principal inertias) are listed, their percentages with respect to total inertia, and a bar
chart (also known as a scree plot). Then for the set of rows and columns a table of results is
given in a standard format, where quantities are either multiplied by 1000 or expressed in permills
(thousandths): the mass of each point (x1000), the quality of display in the solution subspace ofnd
dimensions, the inertia of the point (in permills of the total inertia), and then for each dimension of
the solution the principal coordinate (x1000), the (relative) contribution COR of the principal axis
to the point inertia (x1000) and the (absolute) contribution CTR of the point to the inertia of the
axis (in permills of the principal inertia).
For supplementary points, masses, inertias and absolute contributions (CTR) are not applicable, but
the relative contributions (COR) are valid as well as their sum over the set of chosen nddimensions
(QLT).
Examples
data("wg93")
summary(mjca(wg93[,1:4]))
-
8/10/2019 CA Package
21/22
wg93 21
wg93 International Social Survey Program on Environment 1993 - western
German sample
Description
This data frame contains records of four questions on attitude towards science with responses on
a five-point scale (1=agree strongly to 5=disagree strongly) and three demographic variables (sex,
age and education).
Usage
data(wg93)
Format
Data frame (871x7).
Source
ISSP (1993). International Social Survey Program: Environment. http://www.issp.org
http://www.issp.org/http://www.issp.org/ -
8/10/2019 CA Package
22/22
Index
Topicdatasetsauthor,2
smoke,18
wg93,21
Topicmultivariateca,2
iterate.mjca,5
mjca,6
author,2
ca,2,9,11,1517,19
eigen,7
iterate.mjca,5
mjca,5,6,12,14,17,18,20
pchlist,8,10,11,13,14
plot,10,13
plot.ca,4,8,9,9
plot.mjca,7,12
plot3d.ca,4,8,9,11,14
points,10,13
print.ca,4,11,16
print.mjca,7,14,16
print.summary.ca,17
print.summary.mjca,18
smoke,18
summary.ca,4,11,16,17,19
summary.mjca,7,14,17,18,20
svd,4
wg93,21
22