Question

Use the data mtcars in R: 1. Describe the data in R. (e.g., how many variables,...

Use the data mtcars in R:

1. Describe the data in R. (e.g., how many variables, types of variables).

2. Clean the data by deleting missing values.

3. Normalize the data/standardize the variables.

4. Determine the number of clusters.

5. Use k means cluster analysis.

6. Get cluster means.

7. Visualize the clustering result.

Homework Answers

Answer #1

Solution-A:

Rcode:

dim(mtcars)
colnames(mtcars)

there were 32 observations and 11 columns.they are

mpg" "cyl" "disp" "hp" "drat" "wt" "qsec" "vs" "am" "gear"
"carb"

Solution-B

mydata <- na.omit(mtcars) # listwise deletion of missing
mydata <- scale(mydata)

3. Normalize the data/standardize the variables.

mydata <- scale(mydata)
mydata

4. Determine the number of clusters.

dim(mydata)
wss <- (nrow(mydata)-1)*sum(apply(mydata,2,var))
for (i in 2:15) wss[i] <- sum(kmeans(mydata,
centers=i)$withinss)
plot(1:15, wss, type="b", xlab="Number of Clusters",
ylab="Within groups sum of squares")

#k=9 clusters


K-Means Cluster Analysis
fit <- kmeans(mydata, 9)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 6)...
MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 6) Consider the following dataset: ID V W X Y Z 1 10 2 8 Group 1 A 2 2 8 3 Group 1 A 3 2 8 5 Group 2 A 4 2 10 2 Group 2 A 5 5 2 5 Group 2 A 6 5 5 3 Group 1 B 7 10 7 1 Group 2 B 8 2 9 10 Group...
As part of the quarterly reviews, the manager of a retail store analyzes the quality of...
As part of the quarterly reviews, the manager of a retail store analyzes the quality of customer service based on the periodic customer satisfaction ratings (on a scale of 1 to 10 with 1 = Poor and 10 = Excellent). To understand the level of service quality, which includes the waiting times of the customers in the checkout section, he collected data on 100 customers who visited the store; see the attached Excel file: ServiceQuality. Using Data Mining > Cluster,...
Use the data values in the table below to calculate the correlation, r, between the variables...
Use the data values in the table below to calculate the correlation, r, between the variables x and y. Hint: Use technology to do this...you do not need to compute this by hand. x y 1 17.98 2 21.56 3 25.84 4 27.72 5 27.4 6 29.18 7 33.56 8 32.44 9 35.82 Give your answer to rounded three decimal places.
Use R to do each of the following. Use R code instructions that are as general...
Use R to do each of the following. Use R code instructions that are as general as possible, and also as efficient as possible. Use the Quick-R website for help on finding commands. 1. Enter the following values into a data vector named Dat: 45.4 44.2 36.8 35.1 39.0 60.0 47.4 41.1 45.8 35.6 2. Calculate the difference between the 2nd and 7th entries of this vector using only reference indices. 3. Calculate the median of Dat. 4. Sort the...
PLEASE FILL IN THE BLANKS WITH THE PROPER TERM! THANKS Key Terms ---------------------------------------------------------------------------------------------------------------------------- Positive relationship ---...
PLEASE FILL IN THE BLANKS WITH THE PROPER TERM! THANKS Key Terms ---------------------------------------------------------------------------------------------------------------------------- Positive relationship --- Occurs in so far as pairs of observations tend to occupy similar relative positions in their respective distribution. Negative relationship --- Occurs in so far as pairs of observations tend to occupy dissimilar relative positions in their respective distribution. Scatterplot --- a graph containing a cluster of dots that represents all pairs of observations. Person correlation coefficient --- A number between –1 and +1...
The 2015 American Time Use survey contains data on how many minutes of sleep per night...
The 2015 American Time Use survey contains data on how many minutes of sleep per night each of 10,900 survey participants estimated they get. The times follow the Normal distribution with mean 529.9 minutes and standard deviation 135.6 minutes. An SRS of 100 of the participants has a mean time of ?¯=514.4 minutes. A second SRS of size 100 has mean ?¯=539.3 minutes. After many SRSs, the values of the sample mean ?¯ follow the Normal distribution with mean 529.9...
The goal of statistics is to use data to understand something about the world. To obtain...
The goal of statistics is to use data to understand something about the world. To obtain useful results, a scientific approach should be followed. The basic approach can be summarized into a few steps. Write a question that can be answered by collecting data. Determine what variables to measure and how to collect a data sample. Analyze the data and create appropriate summaries. Create a report of the results, drawing conclusions or inferences where appropriate. For example, suppose you are...
Data For Tasks 1-8, consider the following data: 7.2, 1.2, 1.8, 2.8, 18, -1.9, -0.1, -1.5,...
Data For Tasks 1-8, consider the following data: 7.2, 1.2, 1.8, 2.8, 18, -1.9, -0.1, -1.5, 13.0, 3.2, -1.1, 7.0, 0.5, 3.9, 2.1, 4.1, 6.5 In Tasks 1-8 you are asked to conduct some computations regarding this data. The computation should be carried out manually. All the steps that go into the computation should be presented and explained. (You may use R in order to verify your computation, but not as a substitute for conducting the manual computations.) A Random...
What are standard conditions of ΔH° for the data you will use? Temperature 0 K 100...
What are standard conditions of ΔH° for the data you will use? Temperature 0 K 100 K 273 K 298 K Pressure 1.0 Pa 100 Pa 1.0 bar 100 bar Concentration 1.0 g/L 1.0 mol/L 1.0 mg/L mol/kg Select the complete reactions (including phases) for the reaction between solid NaOH and a solution of HCl. 2NaOH(s) + HCl(aq) → 2NaCl(aq) + H2O(l) NaOH(s) + HCl(aq) → NaCl(aq) + H2O(l) NaOH(s) + HCl(aq) → NaCl(s) + H2O(l) Calculate the theoretical ΔH°r...
NWS620S Tutorial 1: Symmetric Encryption - DES Encryption is the translation of data into a secret...
NWS620S Tutorial 1: Symmetric Encryption - DES Encryption is the translation of data into a secret code so that only authorised entities can read it. Encrypting data is considered a very effective way of achieving data security. To access encrypted data, you must have access to a secret key that enables you to decrypt it. Unencrypted data is called plain text; encrypted data is referred to as cipher text. There are two types of encryption: • Symmetric encryption • Asymmetric...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT