Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8231441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:29:35+00:00 2026-06-07T17:29:35+00:00

I have problem about group in cluster analysis(hierarchical cluster). As example, this is the

  • 0

I have problem about group in cluster analysis(hierarchical cluster). As example, this is the dendrogram of complete linkage of Iris data set.

enter image description here

After I use

> table(cutree(hc, 3), iris$Species)

This is the output:

  setosa versicolor virginica
1     50          0         0
2      0         23        49
3      0         27         1

I have read in one statistical website that, object 1 in the data always belongs to group/cluster 1. From the output above, we know that setosa is in group 1. Then, how I am going to know about the other two species. How do they fall into either group 2 or 3. How did it happen. Perhaps there is a calculation I need to know?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:29:37+00:00Added an answer on June 7, 2026 at 5:29 pm

    I’m guessing that you’re using this to create that image that doesn’t appear to be there at the moment.

    > lmbjck <- cutree(hclust(dist(iris[1:4], "euclidean")), 3)
    > table(lmbjck, iris$Species)
    
    lmbjck setosa versicolor virginica
         1     50          0         0
         2      0         23        49
         3      0         27         1
    

    Dist is created from measurements of plants from three different species with identical column and row names.

    > iris.dist <- dist(iris[1:4], "euclidean")
    > identical(rownames(iris.dist), colnames(iris.dist))
    [1] TRUE
    

    That object is passed on to hclust which constructs a tree and cut it into three pieces. Object iris.order holds the order by which the dendrogram is drawn. Original order is preserved, the tree is drawn based on this ordering.

    > iris.hclust <- hclust(iris.dist)
    > iris.cutree <- cutree(iris.hclust, 3)
    > iris.order <- iris.hclust$order
    

    Here’s proof. I’ve put together original Species designations, ordered species designations as they can be seen in the dendrogram, order number and group from a cutree function.

    > data.frame(original = iris$Species, ordered = iris$Species[iris.order],
                 order.num = iris.order, cutree = iris.cutree)
    
          original    ordered order.num cutree
    1       setosa  virginica       108      1
    2       setosa  virginica       131      1
    3       setosa  virginica       103      1
    4       setosa  virginica       126      1
    5       setosa  virginica       130      1
    6       setosa  virginica       119      1
        ...
    103  virginica     setosa        31      2
    104  virginica     setosa        26      2
    105  virginica     setosa        10      2
    106  virginica     setosa        35      2
    107  virginica     setosa        13      3
    108  virginica     setosa         2      2
        ...
    

    Let’s look at the output. If you look at the first line, under order.num there’s number 108. This means that for this item (first item on the left side of the dendrogram) comes from row 108. Skim down to line 108, and you can see that the original Species is indeed virginica. Cutree assigns this to group 1. Let’s look at line 3. Under order.num you can see that this item comes from row 103. Again, if you go down and check the original species in row 103, it’s (still) virginica. I’ll make it an exercise for you to check other (random) rows and convince yourself that the order for constructing the table at the beginning is preserved. Ergo, the table should thus be correct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem about casting a CallableStatement to OracleCallableStatement . It gives ClassCastException
I have a problem about div position relative alignment. I want the second div
I am using MFC CFile Seek function. I have a problem about Seek out
I have a little problem about the sort direction of a specific column in
I have a great problem about the rotation in three.js I want to rotate
I have a little problem about Google Maps. I'm using Geocoding (xml) for getting
I have a little problem about using jQuery (I really do not know jQuery
I have problem adding arraylist to list view, will explain about my problem here..
I have got a strange problem about in_array recently which I cannot understand. e.g.
I have got a performance problem about TextField.htmlText +=msg .And I know that TextField.appendText(msg)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.