The homals Package

advertisement
The homals Package
May 18, 2005
Version 0.2.4
Date 2005-05-14
Title Homogeneity Analysis in R
Author Jan de Leeuw <deleeuw@stat.ucla.edu> with Arno Ouwehand (arno@stat.ucla.edu)
Maintainer Jan de Leeuw <deleeuw@stat.ucla.edu>
Depends R (>= 1.3), deldir
Description Homogeneity Analysis (HOMALS) package with optional tcl/tk interface. Tcltk, tkrplot
needs to be installed for the tcltk interface to function.
Keyword homals
License LGPL
R topics documented:
cars . . . . . .
catplot . . . . .
ccaUpdateY . .
centerX . . . .
cetacea . . . . .
computeY . . .
galo . . . . . .
graphplot . . .
gubell . . . . .
hartigan . . . .
homals . . . . .
house . . . . .
hullplot . . . .
isDownSatisfied
isUpSatisfied .
lossplot . . . .
mammals . . .
mergeBlockup .
nominalY . . .
normX . . . . .
numericalY . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1
.
.
.
.
.
.
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.
.
.
.
.
.
.
2
3
3
3
3
4
4
4
5
5
6
8
8
8
8
9
9
10
10
10
10
2
cars
objplot . . . . . . . . .
ordinalY . . . . . . . .
orthogonalPolynomials
pava . . . . . . . . . .
pcaUpdateY . . . . . .
polynomialY . . . . .
putBack . . . . . . . .
restrictY . . . . . . . .
senate . . . . . . . . .
sleeping . . . . . . . .
small . . . . . . . . . .
spanplot . . . . . . . .
starplot . . . . . . . .
sumSet . . . . . . . . .
tkhomCheckAll . . . .
tkhomQuit . . . . . . .
tkhomSubmit . . . . .
tkhomals . . . . . . . .
trfplot . . . . . . . . .
weightedGramSchmidt
writeA . . . . . . . . .
writeHead . . . . . . .
writeY . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Index
cars
cars
cars data
Usage
data(cars)
Format
A table containing n observations.
unknown
References
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
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.
.
.
.
.
.
.
.
3
catplot
catplot
catplot
Description
catplot
ccaUpdateY
ccaUpdateY
Description
ccaUpdateY
centerX
centerX
Description
centerX
cetacea
cetacea
Description
cetacea data
Usage
data(cetacea)
Format
A table containing n observations.
Source
unknown
References
4
graphplot
computeY
computeY
Description
computeY
galo
Galo Data
Description
Galo data.
Usage
data(galo)
Format
A table containing n observations.
Source
unknown
References
graphplot
Description
graphplot
graphplot
5
gubell
gubell
Gubell Data
Description
gubell data.
Usage
data(gubell)
Format
A table containing n observations.
Source
unknown
References
hartigan
Hartigan Data
Description
Hartigan Data
Usage
data(hartigan)
Format
A data frame with 24 observations on the following 6 variables.
thread a factor with levels N Y
head a factor with levels C F O R Y
indentation a factor with levels L N T
bottom a factor with levels F S
length a numeric vector
brass a factor with levels N Y
Source
Clustering Algorithms, New York, Wiley, 1975, Table 12.7
6
homals
References
J.A. Hartigan
Examples
data(hartigan)
homals
Homogeneity Analysis
Description
This function performs a homogeneity analysis, aka a multiple correspondence analysis, but with
many additional options. Variables can be grouped into sets, in order to emulate regression analysis
and canonical analysis. For each variable there are, in addition, rank constraints on the category
quantifications (or transformations) and level constraints (which allows one to treat a variable as
nominal, ordinal, or numerical).
The general idea of homogeneity analysis is to make a joint plot in p-space of all objects (or individuals) and the categories of all variables. In this plot we connect objects with the categories they
are in, thus producing a graph plot. If there are m variables, then m lines depart from each object,
and with n object the graph plot has nm lines. The technique, in its most simple form, makes the
graph plot in such a way that the sum of squares of the length of the nm lines is a small as possible,
subject to a normalization of the object scores (their n x p coordinate matrix must be orthonormal).
Rank constraints require the category quantifications of the categories of a variable to lie in a subspace of p-space. Requiring rank equal to one for all variables reduces homogeneity analysis to
principal component analysis (with optimal scaling of the variables).
Sets of variables are incorporated by using additivity restrictions on the category quantifications
(i.e. we code the variables within a set interactively, but then use quantifications based on main
effects only).
By combining the various types of restrictions we obtain far-reaching generalizations of principal
component analysis, canonical analysis, discriminant analysis and regression analysis.
Usage
homals(data, sets=0, ndim=2, active=TRUE, rank=ndim, level="NO", starplots = FAL
catplots = FALSE, trfplots = FALSE, lossplots = FALSE, hullplots = FALSE,
spanplots = FALSE, graphplot = FALSE, objplot = FALSE, objscores = FALSE,
objlabel = FALSE, offset = 1.20, eps1 = -Inf, eps2 = 1e-6, itermax = 100,
voronoi = FALSE, saveMe = FALSE, demo = FALSE , timer = FALSE , tk = FALSE,
img1, img2, img3, name)
Arguments
data
data (in data-frame)
sets
list of vectors of indices
ndim
dimensionality (default 2)
active
which variables are active (single T means all)
rank
which quantification ranks (default all p)
7
homals
level
which quantification levels NO (nominal), OR (orthogonal) (default all nominal)
starplots
which starplots, default is none (FALSE)
catplots
which category plots, default is none (FALSE)
trfplots
which transformation plots, default is none (FALSE)
lossplots
which loss plots, default is none (FALSE)
hullplots
which hullplots, default is none (FALSE)
spanplots
which spanning tree plots, default is none (FALSE)
graphplot
graphplot, default is no (FALSE)
objplot
object score plot, default is no (FALSE)
objscores
object scores written to file, default is no (FALSE)
objlabel
object score plot labeled, default is no (FALSE)
offset
offset for labeled plots, default is 1.20
eps1
iteration precision eigenvalues, default is -Inf
eps2
iteration precision eigenvectors, default is 1e-6
itermax
maximum number of iterations, default is 100
voronoi
voronoi diagram, default is no (FALSE)
saveMe
do we return the results, default is no (FALSE)
demo
animated iteration demo, default is no (FALSE)
timer
time the steps of program, default is no (FALSE)
tk
create tk output, default is no (FALSE), used by tkhomals
img1
tkrplot image placeholder, used by tkhomals
img2
tkrplot image placeholder, used by tkhomals
img3
tkrplot image placeholder, used by tkhomals
name
dataframe name, used by tkhomals
Details
This functions requires data to be stored in a data-frame. It can produce a variety of graphs which
are stored in a pdf file. Results are stored in an ascii file.
Note
Needs to be executed from a writeable directory. File names are determined by the name of the data
argument passed to the function.
Author(s)
Jan de Leeuw
Examples
##
##
##
##
##
produce graphplot and objplot for data set mammals,
results are save into an ascii file "mammals.out"
all graphs are is saved into a pdf file named "mammals.pdf"
Not run: data(mammals)
Not run: homals(mammals, graphplot = TRUE, objplot = TRUE)
8
isUpSatisfied
house
House Data
Description
house data.
Usage
data(house)
Format
A table containing n observations.
Source
unknown
References
hullplot
hullplot
Description
hullplot
isDownSatisfied
isDownSatisfied
Description
isDownSatisfied
isUpSatisfied
Description
isUpSatisfied
isUpSatisfied
9
lossplot
lossplot
lossplot
Description
lossplot
mammals
mammals
Description
List of mammals categorized by dental properties.
Usage
data(mammals)
Format
A data frame with 66 observations on the following 8 variables.
topincisors a numeric vector
bottomincisors a numeric vector
topcanines a numeric vector
bottomcanines a numeric vector
toppremolars a numeric vector
bottompremolars a numeric vector
topmolars a numeric vector
bottommolars a numeric vector
Source
Clustering Algorithms, New York, Wiley, 1975, Table 9.1
References
J.A. Hartigan
Examples
data(mammals)
10
ordinalY
mergeBlockup
mergeBlockup
Description
mergeBlockup
nominalY
nominalY
Description
nominalY
normX
normX
Description
normX
numericalY
numericalY
Description
numericalY
objplot
objplot
Description
objplot
ordinalY
Description
ordinalY
ordinalY
11
orthogonalPolynomials
orthogonalPolynomials
orthogonalPolynomials
Description
orthogonalPolynomials
pava
Pooled Adjacent Violators
Description
This implements the pooled adjacent violators algorithm for monotone regression
pcaUpdateY
pcaUpdateY
Description
pcaUpdateY
polynomialY
polynomialY
Description
polynomialY
putBack
putBack
Description
putBack
restrictY
Description
restrictY
restrictY
12
sleeping
senate
Senate Data
Description
Senate data.
Usage
data(senate)
Format
A table containing n observations.
Source
unknown
References
sleeping
Sleeping Data
Description
sleeping data.
Usage
data(sleeping)
Format
A table containing n observations.
Source
unknown
References
13
small
small
Small Data
Description
small data.
Usage
data(small)
Format
A table containing n observations.
Source
unknown
References
spanplot
spanplot
Description
spanplot
starplot
starplot
Description
starplot
sumSet
Description
sumSet
sumSet
14
tkhomals
tkhomCheckAll
tkhomCheckAll
Description
tkhomCheckAll
tkhomQuit
tkhomQuit
Description
tkhomQuit
tkhomSubmit
tkhomSubmit
Description
tkhomSubmit
Homogeneity Analysis GUI
tkhomals
Description
This function provides a tcl/tk gui for the homals function.
Usage
tkhomals(data)
Arguments
data
data (in data-frame)
Details
This functions requires data to be stored in a data-frame. It can produce a variety of graphs which
are stored in a pdf file. Results are stored in an ascii file.
Note
Needs to be executed from a writeable directory. File names are determined by the name of the data
argument passed to the function.
15
trfplot
Author(s)
Arno Ouwehand
Examples
## present tcl/tk gui for data set senate
## Not run: data(senate)
## Not run: tkhomals(senate)
trfplot
trfplot
Description
trfplot
weightedGramSchmidt
weightedGramSchmidt
Description
weightedGramSchmidt
writeA
writeA
Description
writeA
writeHead
writeHead
Description
writeHead
writeY
Description
writeY
writeY
Index
∗Topic datasets
cars, 1
cetacea, 2
galo, 3
gubell, 4
hartigan, 4
house, 7
mammals, 8
senate, 11
sleeping, 11
small, 12
∗Topic internal
catplot, 2
ccaUpdateY, 2
centerX, 2
computeY, 3
graphplot, 3
hullplot, 7
isDownSatisfied, 7
isUpSatisfied, 7
lossplot, 8
mergeBlockup, 9
nominalY, 9
normX, 9
numericalY, 9
objplot, 9
ordinalY, 9
orthogonalPolynomials, 10
pava, 10
pcaUpdateY, 10
polynomialY, 10
putBack, 10
restrictY, 10
spanplot, 12
starplot, 12
sumSet, 12
tkhomCheckAll, 13
tkhomQuit, 13
tkhomSubmit, 13
trfplot, 14
weightedGramSchmidt, 14
writeA, 14
writeHead, 14
writeY, 14
∗Topic multivariate
homals, 5
tkhomals, 13
cars, 1
catplot, 2
ccaUpdateY, 2
centerX, 2
cetacea, 2
computeY, 3
galo, 3
graphplot, 3
gubell, 4
hartigan, 4
homals, 5
house, 7
hullplot, 7
isDownSatisfied, 7
isUpSatisfied, 7
lossplot, 8
mammals, 8
mergeBlockup, 9
nominalY, 9
normX, 9
numericalY, 9
objplot, 9
ordinalY, 9
orthogonalPolynomials, 10
pava, 10
pcaUpdateY, 10
polynomialY, 10
putBack, 10
restrictY, 10
senate, 11
sleeping, 11
16
INDEX
small, 12
spanplot, 12
starplot, 12
sumSet, 12
tkhomals, 13
tkhomCheckAll, 13
tkhomQuit, 13
tkhomSubmit, 13
trfplot, 14
weightedGramSchmidt, 14
writeA, 14
writeHead, 14
writeY, 14
17
Download