Clustering into ordered clusters In a research study I have a list of countries and data about them. 


*

*GDP

*Population

*Oil exports

*Oil imports

*Percentage of electricity produced with renewable energies

*Urbanization

*Percentage of GDP put into research in renewable energies



Now I would like to cluster these countries into three groups. In the end the group should be equivalent to:


*

*Countries with high ecological standards

*Countries with medium ecological standards

*Countries with low ecological standards



These 3 categories are ordered. I would like to run the model additionally for 5 categories.  
Which clustering algorithm would be most appropriate? Is k-means a good choice in this case? Which dangers arise when I use k-means? If you have some code in R solving a similar problem I would also be grateful.
 A: This is, I think, not a problem for cluster analysis at all. Cluster analysis is unsupervised learning and you want some form of supervision.  
What you seem to want is factor analysis, not cluster analysis, but maybe not FA either. If you already know what "ecological standards" means, you could derive a variable yourself.  If not, then factor analysis of your existing variables might give you a factor that you think of as ecological standards.  
That factor might break up into three groups, but it might not.  I am not srue why you want this to break up into groups (and exactly three).  I think it would be better treated, for almost all purposes, as a continuous variable.
But if you already know which country belongs in which group, then you have a classification task, which calls for other methods. 
A: You might take a look at the 
Wikibooks Example that purports to do almost exactly what you are asking about.   However, I don't really recommend this. 


*

*The "Case Study" given in the posting is poorly executed. The problem there is that the author failed to scale the variables so that only one variable (Per Capita Income) actually makes any difference in the clustering.  

*To paraphrase @PeterFlomm 's answer,  clustering is not classification. If you apply a clustering algorithm, you will get some clusters. However, if you have in mind some underlying classification, there is no reason to believe that your clustering will correspond to the classes. This example is a great case in point. You want clusters that represent ecological standards.  But there are many other classifications of countries that are possible. Why wouldn't the clustering just be rich and poor countries? Long life expectancy and short life expectancy? Countries with rich natural resources and countries without?  Countries with a free press and countries without? The clustering cannot simultaneously reflect all of these things unless they all coincide (which is dubious). Why should you imagine that the clustering corresponds to your collection of classes? If you want to classify, you must figure out how to solve that problem. Clustering where you want classification is a poor choice. 
A: Clustering will not give you clusters like 'high ecological standards'. That is classification.
Therefore, I suggest that you try to either


*

*Define 'high', 'medium' and 'low' expected values for each attribute, and try nearest neighbor classification on these three data points (and carefully adjust data scaling to improve the results!)

*Label examples, such as united states: medium environmental standards and then train a SVM classifier.
Beware that many methods are sensitive to scale. An attribute in the range of billions will overrule attributes which only change a few points. You need to spend a lot of time in optimizing your preprocessing.
