Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • SSC silhouette score computation

    Hi everyone,

    I am working on my thesis and very new to Stata. I am using Stata version 18.5.
    I am trying to compute silhouette scores for my kmeans cluster analysis with 3 clusters after conducting PCA. I retained 3 scores and they are called pca1, pca2, pca3.
    I ran the following:

    cluster kmeans pca1 pca2 pca3, k(3) name(kmeans3) measure(L2Squared)
    matrix dissim di = pca1 pca2 pca3, L2Squared
    silhouette kmeans3, dist(di) id(_uuid) lwidth (0.8 0.8 0.8)

    However, I get the following error:

    option contents() not allowed since Stata 17; see help table for updated syntax

    Is it a syntax error? Could anybody advise me on how to resolve the issue?

    Thank you for your help in advance!

  • #2
    I also encounter a problem when performing silhouette:
    Code:
                 silhgroup():  3301  subscript invalid
                     <istmt>:     -  function returned error
    r(3301);
    Edit:
    After searching Statalist, I find a solution. The thread which I refer to is here:
    https://www.statalist.org/forums/for...in-nested-loop
    Last edited by Chen Samulsion; 29 Dec 2024, 19:38. Reason: find a solution in Statalist

    Comment


    • #3
      Silan Ankara for your question, there's a simple solution. Just use version control.
      Code:
      version 10: silhouette kmeans3, dist(di) id(_uuid) lwidth (0.8 0.8 0.8)

      Comment

      Working...
      X