### Our Services

Get 15% Discount on your First Order

# Check the attachments Please 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.

#### Share This Post

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

## Related Questions

### Write a 1,500-2,000-word essay using at least four resources. The four resources need to include at least two course resources (textbook, topic overviews,

Write a 1,500-2,000-word essay using at least four resources. The four resources need to include at least two course resources (textbook, topic overviews, the Bible) and at least two other sources from the GCU Library to support your points. Remember, the Bible counts as one resource regardless of how many times

### The idea of “Which One Doesn’t Belong” started with a children’s picture book by Christopher Danielson. Danielson’s book included colorful pages containing

The idea of “Which One Doesn’t Belong” started with a children’s picture book by Christopher Danielson. Danielson’s book included colorful pages containing thoughtfully designed sets of four shapes. Each of the shapes can be a correct answer to the question, “Which one doesn’t belong?”- Because all of their answers are

### reflect on your thinking regarding the role of the nurse in the design and implementation of new healthcare programs. Select a healthcare program

reflect on your thinking regarding the role of the nurse in the design and implementation of new healthcare programs. Select a healthcare program within your practice and consider the design and implementation of this program. Reflect on advocacy efforts and the role of the nurse in relation to healthcare

### Purpose: The purpose of this assignment is to interpret and special considerations for families of children with special needs from their children’s

Purpose: The purpose of this assignment is to interpret and special considerations for families of children with special needs from their children’s birth through high school. Directions: Write a reflection discussing your thoughts on this weeks course content. Try to walk a mile in someone else’s shoes and think about

### Write an analysis paragraph for each part #4, #5, & #6. Three paragraphs in total   4. Views on family involvement (SEE ATTACHED- Hoover Dempsey and

Write an analysis paragraph for each part #4, #5, & #6. Three paragraphs in total   4. Views on family involvement (SEE ATTACHED- Hoover Dempsey and Sandler Family Systems Model) -Parent’s motivational beliefs -Parent’s perceptions of invitations for involvement from others -Parents perceived life context 5. Views of teacher/parent roles

### Instructions are attached  Reply to peer · Posts should read approximately 200 words in APA format, including any

Instructions are attached  Reply to peer · Posts should read approximately 200 words in APA format, including any citations Peer: Keanna The term Internet Use Disorder (IUD) refers to a group of symptoms that are brought on by obsessive and excessive internet use, which can cause severe distress or functional

### Answer the following questions regarding the Index case and support your answers with logic, data, and evidence from the case: 1. How should Index

Answer the following questions regarding the Index case and support your answers with logic, data, and evidence from the case: 1. How should Index communicate its value proposition to retailers? 2. Assuming that you were in senior management at a major brick-and-mortar retailer customer of Index, how would you use

### Build a slide presentation (PowerPoint preferred) of the hypothetical health promotion plan you developed previously. Then, implement your health

Build a slide presentation (PowerPoint preferred) of the hypothetical health promotion plan you developed previously. Then, implement your health promotion plan by conducting a hypothetical face-to-face educational session addressing the health concern and health goals of your selected group. How would you set goals for the session, evaluate session outcomes,

### Answer the following questions regarding the Index case and support your answers with logic, data, and evidence from the case: 1. How should Index

Answer the following questions regarding the Index case and support your answers with logic, data, and evidence from the case: 1. How should Index communicate its value proposition to retailers? 2. Assuming that you were in senior management at a major brick-and-mortar retailer customer of Index, how would you use

### Instructions are attached  Reply to peer Responses need to be a minimum of one paragraph of substance in which you add to

Instructions are attached  Reply to peer Responses need to be a minimum of one paragraph of substance in which you add to another student’s posting or clearly articulate (in a respectful manner) why you agree or disagree with the student’s opinion; this effort will result in a grade of “C.”

### In order to respond to this DB, you need to have reviewed the following texts: Read: have entire book read – Romeo & Juliet & Vampires (Gabel)  Watch:

In order to respond to this DB, you need to have reviewed the following texts: Read: have entire book read – Romeo & Juliet & Vampires (Gabel)  Watch: watch film – What We Do in the Shadows (2014) Review: Literary Theory: New Historicism _______________________ DB Writing Prompt: Write a 300-500

### Instructions are attached  Reaction Papers – Introduction A reaction paper is just what its name suggests: a formal paper

Instructions are attached  Reaction Papers – Introduction A reaction paper is just what its name suggests: a formal paper explaining your reaction to a peer-reviewed journal article whose topic is relevant to this course. The paper is a review because your reaction will involve judgment or evaluation; it is an

### Develop a disaster recovery plan to reduce health disparities and improve access to community services after a disaster. Then develop a 10–12 slides

Develop a disaster recovery plan to reduce health disparities and improve access to community services after a disaster. Then develop a 10–12 slides presentation of the plan excluding title and references with lots of speaker notes for the local system, city officials, and the disaster relief team. In this assessment,

### Over the last four weeks, you have learned about corrections, how it functions, and the various populations that are served. The goal of corrections is not

Over the last four weeks, you have learned about corrections, how it functions, and the various populations that are served. The goal of corrections is not to keep people incarcerated; it is to rehabilitate offenders. This week you focus on a large component of reentry and community corrections programs. Imagine

### see attached Differentiate State Regulatory Restrictions on NP Practice Purpose NPs have scopes of practice that are regulated by state laws, boards

see attached Differentiate State Regulatory Restrictions on NP Practice Purpose NPs have scopes of practice that are regulated by state laws, boards of nursing, boards of medicine, and reimbursement that may differ depending on your location. There are several sources of restrictions to NP practice, such as state laws and

### 15 to 20-sentence. Candlelight: A tribute to Adele The Coral Gables Congregational Church Focus:    – Instrument: Identify the primary instrument(s)

15 to 20-sentence. Candlelight: A tribute to Adele The Coral Gables Congregational Church Focus:    – Instrument: Identify the primary instrument(s) featured in the concert.    – Era: Determine the historical era or period the music represents.    – Genre: Categorize the music into a specific genre (e.g., baroque, classical, jazz, pop, rock).

### InstructionsAnnotated Bibliography Assignment Times New Roman, size 12, and double-spaced. Also, make sure you have all of the spaces removed. You are to

InstructionsAnnotated Bibliography Assignment Times New Roman, size 12, and double-spaced. Also, make sure you have all of the spaces removed. You are to use five (5) sources list them just like in the ‘sources’ assignment. Below each source is where you start your paragraphs. Paragraph one (1) is a summary

### DB Writing Prompt: Write a 300-500 word reflection in response to this assignment prompt.Your response to this discussion post should try to create a

DB Writing Prompt: Write a 300-500 word reflection in response to this assignment prompt.Your response to this discussion post should try to create a reflection, with supportive textual evidence, that engages with as many questions as possible, in mini-essay form, while also creating a foundation for how you think about