Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: 2-stages cluster analysis

From   Stas Kolenikov <>
Subject   Re: st: 2-stages cluster analysis
Date   Tue, 14 Sep 2010 10:19:14 -0500

On Tue, Sep 14, 2010 at 6:01 AM, Giancarlo Musto
<> wrote:
> I'd like to run on stata a cluster analysis in 2 stages, but I could not figure out how to do it. To be precise, in the first stage I need to create clusters on the basis of a set of variables, s1, and in the second stage I need to create clusters, within the groups formed in the first stage, using a different set of variables, s2.

I am not quite sure what you mean, but is it something like this?

cluster <method> <the first set of variables>, generate( stage1cl )
levelsof stage1cl
local stage1clusters `r(levelsof)'
forvalues k=1/`stage1clusters' {
   cluster <method> <the second set of variables>, generate( stage2cl`k')
egen stage2cl = group( stage2cl* ), missing

Stas Kolenikov, also found at
Small print: I use this email account for mailing lists only.

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index