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

st: clustering analysis


From   "Vasilis.Sarafidis" <[email protected]>
To   [email protected]
Subject   st: clustering analysis
Date   06 Dec 2005 17:31:35 +0000

Statalist,

I am using the command "cluster kmeans" in order to cluster a sample of objects on the basis of predefined attributes.

The thing is that everytime I run the command, the identity of the clusters changes, although the allocation of the objects is always the same. In other words, if there are 2 clusters only, then the first cluster takes one time the value of 1 and another time the value of 2. And vice versa for cluster 2.

The problem is that in my case I want to simulate some attributes and check how well does the clustering command do (on average) in allocating the objects into the correct clusters.

Notice that all the objects are ordered, in the sense that the first N/2 objects (that belong to the first cluster) are entered first.

Is there any way I can tell the program to make the identity of the first cluster always equal to 1 and the identity of the second cluster equal to 2? Then in each replication I can easily find out whether the cross-sections have been allocated in the correct cluster.

Many thanks for your help.

Vasilis

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




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