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
marginsplot generating hard-to-read picturesDear All, I am running > marginsplot, recast(scatter) to illustrate margins & CIs and what re…
Rolling window standard deviation of residuals in ARIMADear Statalist community, I have trouble writing the code and would greatly appreciate your help. …
Diff in diff with IV for treatment dummyHi all, For my data analysis, I am estimating a difference-in-difference model of the sort Code: …
Delete observations within timespan of each otherDear all, I am writing my Master's Thesis and am currently cleaning my data. For each Company I wan…
Calculating the turning pointHi, My name is Jan, and I would like to find the turning point for my regression. I looked at previ…
Subscribe to:
Post Comments (Atom)
0 Response to K-means clustering
Post a Comment