Dear Stata users,
I performed the K-means clustering analysis on stock market cash-flow and discount-rate betas. To visualize my results I created the scatterplot which 7 different groups. How can I transform my graph so I can exactly know which stocks are in each cluster? (Instead of getting differently coloured points). Here the code I used:
graph twoway (scatter beta_cf beta_dr if k7r == 1, mcolor(orange)) (scatter beta_cf beta_dr if k7r== 2, mcolor(green) ) (scatter beta_cf beta_dr if k7r == 3,mcolor(blue)) (scatter beta_cf beta_dr if k7r == 4, mcolor(red)) (scatter beta_cf beta_dr if k7r == 5, mcolor(purple)) (scatter beta_cf beta_dr if k7r == 6, mcolor(darkgreen)) (scatter beta_cf beta_dr if k7r == 7, mcolor(cranberry)), legend(label(1 "cluster1") label(2 "cluster2") label(3 "cluster3") label(4 "cluster4") label(5 "cluster5") label(6 "cluster6") label(7 "cluster7"))
Any help would be much appreciated!
Related Posts with K-means clustering
Linear state spaceI have been largely benefited from this forum every time I post a question or I am looking for a que…
coefplot: how to fix the scaling for different coefficients?!Hi I am not getting a clear figure with coefplot. I think the problem is that the coefficients and …
Recode a variable to the same previous value by categoryDear community, SOS! I have a panel data containing household information that was collected mainl…
removing duplicates based on a criteriaHello, I have a dataset with village names and their respective populations. Villages belong to diff…
creating matrix of coefficient covariance valueshi-- I would like to create matrices of the coefficient covariance matrices generated by the code: …
Subscribe to:
Post Comments (Atom)
0 Response to K-means clustering
Post a Comment