# Check the attachmentsPlease read the instructions and questions carefully in ” Assignment_5_2024_Fall.pdf” file and use “Auto.csv” to finish the as

Check the attachments

## Please read the instructions and questions carefully in ” Assignment_5_2024_Fall.pdf” file and use “Auto.csv” to finish the assignment. You should submit both 1) an R code ; 2) A PDF report with answers through the link “Submit Assignment 5 Here”.

Guidelines:

· Use only R for this assignment

· Submit both R code and Report on findings

· Work is to be done individually for this assignment

1. In this problem, you will generate simulated data, and then perform K-means clustering on the data.

1.1 Generate a simulated data set with 30 observations in each of two classes (i.e. 60 observations in total), and 2 variables.

Code Hint: The first four lines of codes should be:

set.seed(2) x=matrix(rnorm(60*2), ncol=2) x[1:30,1]=x[1:30,1]+3

x[1:30,2]=x[1:30,2]-4

1.2 Perform K-means clustering of the observations with K = 2. Plot the data with each observation colored according to its cluster assignment (nstart=20). Take a screenshot of your plot. What is the total within-cluster sum of squares?

1.3 Perform K-means clustering with K = 3. Plot the data with each observation colored according to its cluster assignment (nstart=20). Take a screenshot of your plot. What is the total within-cluster sum of squares?

1.4 Now perform K-means clustering with K = 4. Plot the data with each observation colored according to its cluster assignment (nstart=20). Take a screenshot of your plot. What is the total within-cluster sum of squares?

1.5 Using the scale () function, perform K-means clustering with K = 2 on the data after scaling each variable to have standard deviation one. Take a screenshot of your plot. What is the total within-cluster sum of squares now? How do these results compare to those obtained in (2)?

1

2. Consider the USArrests data. We will now perform hierarchical clustering on the states. USArrests dataset is part of the base R package. You do not need to load any libraries.

2.1 Plot the hierarchical clustering dendrogram using complete linkage clustering with Euclidean distance as the dissimilarity measure. Take a screenshot of your plot.

2.2 Cut the dendrogram at a height that results in three distinct clusters. Which states belong to which clusters? You need to provide state names for each cluster (e.g. Cluster 1 has Alabama, Alaska,…).

2.3 Hierarchically cluster the states using complete linkage and Euclidean distance, after scaling the variables to have standard deviation one.

a) Take a screenshot of your plot.

b) What effect does scaling the variables have on the hierarchical clustering obtained?

c) In your opinion, should the variables be scaled before the inter-observation dissimilarities are computed? Provide a justification for your answer.

2.4 After scaling the variables to have standard deviation one, plot the hierarchical clustering dendrogram using average linkage clustering with Euclidean distance as the dissimilarity measure. Take a screenshot of your plot.

2.5 After scaling the variables to have standard deviation one, plot the hierarchical clustering dendrogram using single linkage clustering with Euclidean distance as the dissimilarity measure. Take a screenshot of your plot.

What to submit:

1.
R code.

a. Should include all the code to accomplish the tasks.

b. Clear and concise comments to indicate what part of the assignment each code chunk pertains to.

c. Code should be easily readable.

d. Filename should be in the format of: LastnameFirstname_A5.R

2.
Report.

a. Take screenshots of your outputs in R Studio and answer all the questions.

b. Submit in PDF format.

c. Answers questions clearly and concisely.

d. Includes appropriate plots. Make sure the plots are properly labeled.

e. The assignment will be graded on the correctness of the answers, comprehensiveness of the analysis, clarity of results’ presentation and neatness of the report.

Order a Similar Paper and get 15% Discount on your First Order

## Related Questions

### (Do you think having a disability detracts from the goodness of a person’s life? Why or why not?) Thesis essay topic! This is meant to be a THESIS ESSAY.

(Do you think having a disability detracts from the goodness of a person’s life? Why or why not?) Thesis essay topic! This is meant to be a THESIS ESSAY. This is NOT meant to be a report about any of the above topics. In addition to including reasons for your thesis, your paper should

### Informed Consent Form By the due date assigned, submit the Informed Consent Letter to the Submissions Area (please note that this is only an example and no

Informed Consent Form By the due date assigned, submit the Informed Consent Letter to the Submissions Area (please note that this is only an example and no data may be collected).     Informed Consent Letter    Procedure section is clear, described in detail, specific, and all inclusive. Written in lay language (as

### Discussion Question Using the Excel Sheet and descriptive statistics page; you will write up your analysis for the 20 participants. This week, you learned

Discussion Question Using the Excel Sheet and descriptive statistics page; you will write up your analysis for the 20 participants. This week, you learned about the statistical software applications used to analyze data for research analysis. For this week’s discussion, you will use Excel sheet provide to run descriptive statistics,

### STRATEGIES FOR ACADEMIC PORTFOLIOS In the realm of marketing, a successful branding strategy is one of the most important contributors to

STRATEGIES FOR ACADEMIC PORTFOLIOS In the realm of marketing, a successful branding strategy is one of the most important contributors to organizational success. A solid branding strategy can help add visibility and credibility to a company’s products. Similarly, nurse-scholars can build a personal brand to add visibility and credibility to

### Empowerment hub for young women speak in 1st person I will put my name in the spots  Business Plan Step 1: Topic Step 2: Background ResearchReview

Empowerment hub for young women speak in 1st person I will put my name in the spots  Business Plan Step 1: Topic Step 2: Background Research Review literature related to your      topic to understand the theoretical and practical aspects. Identify key concepts, theories,      and empirical findings relevant to your research

### See Attachment below.Writing Assignment #2- BIOL 150 (75 Points)Victoria’s Story- Past, Present, and Future

See Attachment below. Writing Assignment #2- BIOL 150 (75 Points) Victoria’s Story- Past, Present, and Future In recent times, science has progressed tremendously in its potential to treat genetic diseases such as sickle cell anemia with a new technique called CRISPR. By utilizing the resources in this folder, you will

### I need you to complete a presentation on ‘Financial Decision Making.’ Here are the specific requirements:Complete a PowerPoint presentation according

I need you to complete a presentation on ‘Financial Decision Making.’ Here are the specific requirements: Complete a PowerPoint presentation according to the requirements. Based on the PowerPoint, prepare a speech of approximately 15-20 minutes. Note: I have uploaded all the textbooks related to this course. I need you to

### To prepare:Review the Learning Resources associated with the topics: Health Literacy, Health Information Technology (HIT) on Patient Outcomes, and

To prepare: Review the Learning Resources associated with the topics: Health Literacy, Health Information Technology (HIT) on Patient Outcomes, and Health Economics. Consider the role of each of these topics in influencing how healthcare is delivered and practiced in your healthcare organization or nursing practice.  Post a cohesive response that

### GROUP SEO VIDEO PROJECT (40 points)The objective of this assignment is to give you experience with the various aspects of search engine

GROUP SEO VIDEO PROJECT (40 points) The objective of this assignment is to give you experience with the various aspects of search engine optimization, including keyword research and content optimization, by creating a video and optimizing it for YouTube. Publish your group’s SEO Video on YouTube before class on the

### Write a 3-page paper regarding the overview of post-market surveillance for pharmaceuticals, pesticides and industrial chemicals in Canada for a non-expert

Write a 3-page paper regarding the overview of post-market surveillance for pharmaceuticals, pesticides and industrial chemicals in Canada for a non-expert but educated public audience.  In this description, students should demonstrate their knowledge of the following in any order they view as most effective for public communication: The prominent features

### The case study link is provided below for the Case Study 2. Read and study the case and complete the questions at the end of the study. Use the case study

The case study link is provided below for the Case Study 2. Read and study the case and complete the questions at the end of the study. Use the case study outline below to assist you with your analysis. Questions should be answered using case study format. Ensure that you

### do not try to finish this homework assignment without understanding the concepts involved with forecasting using statistical regression. Once you know how

do not try to finish this homework assignment without understanding the concepts involved with forecasting using statistical regression. Once you know how regression works, download the attached Excel Template onto your computer. You will utilize this template for your assignment . Begin by opening the Excel File and reading through

### hey, can you put the community assessment in a powerpoint. You did the assignment already I just need it in a PowerPoint . I can create another question if

hey, can you put the community assessment in a powerpoint. You did the assignment already I just need it in a PowerPoint . I can create another question if you can .

### In your own words, briefly explain a system. Based on the course material thus far, how is U.S. health care a system? Why might some argue that the

In your own words, briefly explain a system. Based on the course material thus far, how is U.S. health care a system? Why might some argue that the U.S. health system is not a system? Your post should be between 250-500 words. This equates to approximately one to two pages

### No plagiarism or Ai 1) Choose a current or past white-collar criminal case from Outside the U.S 2) You will find any 3 media sources (could be articles,

No plagiarism or Ai 1) Choose a current or past white-collar criminal case from Outside the U.S 2) You will find any 3 media sources (could be articles, documentaries, podcast, or a combination) that covered the case. 3) You will write an 800-word paper (double spaced) that discusses the media

### RESPOND TO THESE PEERS DISCUSSIONjaneAccording to the Clark Healthy Workplace Inventory, the civility score for my workplace was 74, which

RESPOND TO THESE PEERS DISCUSSION jane According to the Clark Healthy Workplace Inventory, the civility score for my workplace was 74, which indicates moderately healthy (“Clark Healthy,” 2015). My workplace scored high in the areas of celebrating individual achievements and fair and equitable treatment. On the contrary, it scored low in

### FinalI decided to change my topic to something that I am familiar with. Hope this is ok. 1. Complete the five steps to

Final I decided to change my topic to something that I am familiar with. Hope this is ok. 1. Complete the five steps to writing your research question as shown in the lecture.  · Find something you are interested in and knowledgeable about. I am a Certified Nursing Assistant and

### Use the file attached Visualization Plan. Please include the following You will make at least six charts, including at least one geographic map, at

Use the file attached  Visualization Plan. Please include the following  You will make at least six charts, including at least one geographic map, at least one bar, at least one table, and at least one line chart. Describe how your data set(s) will provide enough variables to create the required