{smcl}
{* 02apr2004}{...}
{hline}
help for {hi:cluster dendrogram}{right:manual:  {hi:[CL] cluster dendrogram}}
{right:dialog:  {dialog cltree:cluster dendrogram}     }
{hline}

{title:Dendrograms for hierarchical cluster analysis}

{p 8 27 2}{cmd:cluster} {cmdab:dend:rogram} [{it:clname}]
	[{cmd:if} {it:exp}] [{cmd:in} {it:range}]
	[{cmd:,} {cmd:quick}
	{cmdab:la:bels:(}{it:varname}{cmd:)}
	{cmdab:vertl:abels}
	{cmdab:cutn:umber:(}{it:#}{cmd:)}
	{cmdab:cutv:alue:(}{it:#}{cmd:)}
	{cmdab:labc:utn}
	{cmdab:sa:ving:(}{it:filename}[{cmd:,} {cmd:replace}]{cmd:)}
	{cmd:scale(}{it:#}{cmd:)}
	{it:title_options}
	{it:axes_options}
	{it:color_options}
	]


{p 4 4 2}
Note: {cmd:cluster} {cmdab:tr:ee} is a synonym for
{cmd:cluster} {cmd:dendrogram}.

{p 4 4 2}
In addition to the restrictions imposed by {cmd:if} and {cmd:in}, the
observations are automatically restricted to those that were used in the
formation of the cluster analysis.


{title:Description}

{p 4 4 2}
{cmd:cluster dendrogram} produces dendrograms (also called cluster trees)
from a hierarchical clustering.  See help {help cluster} for a list of the
available {cmd:cluster} commands.

{p 4 4 2}
Dendrograms graphically present the information concerning which observations
are grouped together at various levels of (dis)similarity.  At the bottom of
the dendrogram, each observation is considered its own cluster.  Vertical
lines extend up for each observation, and at various (dis)similarity values
these lines are connected to the lines from other observations with a
horizontal line.  The observations continue to combine until, at the top of
the dendrogram, all observations are grouped together.

{p 4 4 2}
The height of the vertical lines and the range of the (dis)similarity axis
give visual clues about the strength of the clustering.  Long vertical lines
indicate more distinct separation between the groups.  Long vertical lines
at the top of the dendrogram indicate that the groups represented by those
lines are well separated from one another.  Shorter lines indicate groups that
are not as distinct.


{title:Options}

{p 4 8 2}
{cmd:quick} switches to a different style of dendrogram where
the vertical lines only go straight up from the observations, instead of the
default action of recentering the lines after each merge of observations in
the dendrogram hierarchy.  Some people prefer this representation, and it is
quicker to render.

{p 4 8 2}
{cmd:labels(}{it:varname}{cmd:)} indicates that {it:varname} is to
be used in place of observation numbers for labeling the observations at the
bottom of the dendrogram.

{p 4 8 2}
{cmd:vertlabels} indicates that the labeling for the observations at
the bottom of the dendrogram is to be presented vertically instead of
horizontally.  This is helpful when the labels have several characters and
there are enough observations in the dendrogram to cause the labels to
overlap.

{p 4 8 2}
{cmd:cutnumber(}{it:#}{cmd:)} displays only the top {it:#} branches of
the dendrogram.  With large dendrograms, the lower levels of the tree become
too crowded.  With {cmd:cutnumber()}, you can limit your view to the upper
portion of the dendrogram.  Also see the {cmd:cutvalue()} and {cmd:labcutn}
options.

{p 4 8 2}
{cmd:cutvalue(}{it:#}{cmd:)} displays only the top portion of the
dendrogram.  Only those branches of the dendrogram that are above the {it:#}
(dis)similarity measure are presented.  With large dendrograms, the lower
levels of the tree become too crowded.  With {cmd:cutvalue()}, you can limit
your view to the upper portion of the dendrogram.  Also see the
{cmd:cutnumber()} and {cmd:labcutn} options.

{p 4 8 2}
{cmd:labcutn} requests that the number of observations associated with
each branch be displayed below the branches.  {cmd:labcutn} is allowed only
with {cmd:cutnumber()} or {cmd:cutvalue()} since, otherwise, the number of
observations for each branch is one.

{p 4 8 2}
{cmd:saving(}{it:filename}[{cmd:,} {cmd:replace}]{cmd:)} saves the
graph in a file that can be reviewed by {cmd:graph} {cmd:using} (see help
{help graph}) and printed by pulling down the {hi:File} menu and choosing
{hi:Print Graph}.  If you do not specify an extension, {hi:.gph} will be
assumed.

{p 4 8 2}
{cmd:scale(}{it:#}{cmd:)} sets the font size of titles and axes labels.
The default font size is 1.  {cmd:scale(2)} would use a font size twice
the size of the default, while {cmd:scale(0.5)} would use a font size half
the size of the default.

{p 4 8 2}
{it:title_options} are:  {cmdab:ti:tle:(}{it:"text"}{cmd:)},
{cmdab:b1:title:(}{it:"text"}{cmd:)}, {cmdab:b2:title:(}{it:"text"}{cmd:)},
{cmdab:t1:title:(}{it:"text"}{cmd:)}, {cmdab:t2:title:(}{it:"text"}{cmd:)},
{cmdab:l1:title:(}{it:"text"}{cmd:)}, {cmdab:l2:title:(}{it:"text"}{cmd:)},
{cmdab:r1:title:(}{it:"text"}{cmd:)}, and {cmdab:r2:title:(}{it:"text"}{cmd:)}.

{p 8 8 2}
Two titles are allowed on every side of the figure.  The sides are referred to
as {cmdab:t:op}, {cmdab:b:ottom}, {cmdab:l:eft}, and {cmdab:r:ight}.  The
first (#1) title on a side is always farther from the figure.  {cmd:title()}
and {cmd:b1title()} are synonyms, and may not be specified together.

{p 8 8 2}
Usually, the quotes can be omitted from {it:"text"} if {it:text} contains
no special characters.  If the {it:text} itself contains quotes, then
compound double quotes ({cmd:`"} and {cmd:"'}) must be used.

{p 4 8 2}
{it:axes_options} are:  {cmdab:noax:is},
{cmdab:g:ap:(}{it:#}{cmd:)}, {cmdab:yla:bel}[{cmd:(}{it:numlist}{cmd:)}],
{cmdab:rla:bel}[{cmd:(}{it:numlist}{cmd:)}],
{cmdab:yt:ick:(}{it:numlist}{cmd:)}, and {cmdab:rt:ick:(}{it:numlist}{cmd:)}.

{p 8 12 2}
{cmd:noaxis} requests that no y axis be drawn.

{p 8 12 2}
{cmd:gap(}{it:#}{cmd:)} sets the amount of space between the left title and the
values along the axis.  The default is 8.  You can close or widen the gap.

{p 8 12 2}
{cmd:ylabel}[{cmd:(}{it:numlist}{cmd:)}] and
{cmd:rlabel}[{cmd:(}{it:numlist}{cmd:)}] specify left and right axes labels.
By default, {cmd:cluster tree} labels just the minimum and maximum on the left
axis and does not use a right axis.  {cmd:ylabel} and {cmd:rlabel}, without
arguments, chooses "round" values for labeling the axes.  With arguments, the
values you specify will be labeled.

{p 8 12 2}
{cmd:ytick(}{it:numlist}{cmd:)} and {cmd:rtick(}{it:numlist}{cmd:)} place tick
marks on the left and right axes.  By default, {cmd:cluster tree} places
tick marks wherever axes are labeled, so these options allow specifying
additional ticking.

{p 4 8 2}
{it:color_options} are:  {cmd:bgcolor(}{it:#r #g #b}{cmd:)},
{cmd:textcolor(}{it:#r #g #b}{cmd:)}, and
{cmd:treecolor(}{it:#r #g #b}{cmd:)}.  ({it:#r}) red, ({it:#g}) green, and
({it:#b}) blue are the color components.  The color component values range
from 0 to 255.

{p 8 12 2}
{cmd:bgcolor(}{it:#r #g #b}{cmd:)} sets the background color of the graph.
The default background color is light blue -- {cmd:bgcolor(225 230 240)}.

{p 8 12 2}
{cmd:textcolor(}{it:#r #g #b}{cmd:)} sets the text color.  The default
text color is black -- {cmd:textcolor(0 0 0)}.

{p 8 12 2}
{cmd:treecolor(}{it:#r #g #b}{cmd:)} sets the tree color.  The default
tree color is navy -- {cmd:treecolor(39 63 111)}.


{title:Examples}

{p 4 8 2}{cmd:. cluster dendrogram L2clnk, vertlab ylab labels(labt)}{p_end}
{p 4 8 2}{cmd:. cluster dend L2clnk, vertlab ylab labels(labt) quick}{p_end}
{p 4 8 2}{cmd:. cluster tree if g3==3, ylab}{p_end}
{p 4 8 2}{cmd:. cluster tree, cutn(15) labcutn rlabel}{p_end}
{p 4 8 2}{cmd:. cluster tree, cutvalue(75.3) vertlab}


{title:Also see}

{p 4 13 2}
Manual:  {hi:[CL] cluster},{break}
{hi:[CL] cluster dendrogram}

{p 4 13 2}
Online:  help for {help cluster};
{help cluster averagelinkage},
{help cluster centroidlinkage},
{help cluster completelinkage},
{help cluster generate},
{help cluster medianlinkage},
{help cluster notes},
{help cluster programming},
{help cluster singlelinkage},
{help cluster stop},
{help cluster utility},
{help cluster wardslinkage},
{help cluster waveragelinkage},
{help dissimilarity}
{p_end}
