Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: St: cluster graphing

Subject   Re: st: St: cluster graphing
Date   Thu, 24 Jun 2004 17:09:06 -0500

Justin <> asks,

> I did a nonheirarchical cluster analysis, using 3 variables and obtaining 9
> clusters.  I am trying to graph this so I can visually show how these clusters
> were classified, but the cluster tree only works for heirarchical.
> Does anyone have any suggestions?

Dendrograms are designed to display hierarchical cluster
solutions.  For nonhierarchical clustering (such as kmeans and
kmedians) there are several approaches for visualizing the
resulting cluster solutions.

The Stata Journal carried an article titled "The clustergram: A
graph for visualizing hierarchical and nonhierarchical cluster
analyses", by Matthias Schonlau.  It was in

    The Stata Journal (2002) 2, Number 4, pp. 391-402

You can find it in stata and download the associated Stata
command by using -search-

    . search cluster graph

or to narrow the search to just that item

    . search clustergram

If you don't already have access to the actual SJ article, you
can visit

for information on obtaining it.

Other traditional approaches include

1) Graph the first 2 principal components of the data and use the
   cluster identifier (number) to determine the plotting symbol.

2) Similar idea as above, but use various combinations of 2 of
   your original variables instead of the principal components.

   In your case, you mention clustering on 3 variables (let me
   call them v1, v2, and v3).  So, you might decide to create 3
   graphs: v1 vs. v2, v1 vs.  v3, and v2 vs. v3.  And again, with
   each of these graphs use the cluster identifier (number) to
   determine the plotting symbol.

There are probably other approaches as well.

Ken Higbee
StataCorp     1-800-STATAPC

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index