Suppose I have a list of, say, 100 countries, as well as their respective historical sovereign credit ratings as such
2020 2019 ... 2000
Country 1 AAA A- ... BBB
Country 2 CCC B- ... BBB
...................................
I am interested in clustering these based on their historical credit ratings. For instance, I expect two countries that have consistently rated highly over the years (say ratings between A- and AAA) would cluster together, countries with varying degrees of ratings (from low to high) over the years 2000 and 2020 would also cluster together, and countries that have consistently rated poorly also. I have looked at a few suggestions online for clustering categorical data based on multiple variables, but usually they are not for ordered categorical data. For instance, the dissimilarity matrix generated by Kmodes, is predicated on the two categories being identical. However, in ordered categorical data, a rating of BBB+ and BBB are incredibly close to one another and thus must be clustered together.
What would be a good solution to such clustering exercise for the countries given the example above?