Question: 1. In this problem we will use the tumor data set. (a) Read the data in and remove the first column, which corresponds to the

 1. In this problem we will use the tumor data set.

1. In this problem we will use the tumor data set. (a) Read the data in and remove the first column, which corresponds to the diagnosis. We now have a dataset with only X variables. (b) Conduct a PCA analysis. being sure to center and scale the variables. Provide a plot of the variation explained by each PC. How many principal components do you think should be kept? (Hint: In R pca.out = prcomp(tumor, scale=TRUE) pca.var = pca.out$sdev**2 pve = pca.var/sum(pca.var) plot(pve); plot(cumsum(pve) (c) How much of the total variation in the data is explained by 2 principal components? By 3? (d) Print the principal component loadings, which describe how all of the variables combine to form the PC variables. Interpret the first 2 principal components. (Hint: See Lab 10.4 in the book and the interpretations in the second half of Section 10.2.1 in the ISLR text. In R, pca.out$rotation) (e) Make a biplot of the first 2 principal components and interpret. (Hint: In R, biplot(pca.out, scale=0)) 2. Now, we will use K-means and hierarchical clustering on the data. (a) How many clusters do you think we should specify? Why? (b) Conduct K-means clustering with 2 clusters. What are the cluster means? (Hint, In R, set.seed(1) km.out = kmeans(tumor,2,nstart=20) (c) Make a scatterplot matrix between all variables and color the points by cluster. Describe your findings. (Hint. In R, pairs(tumor, col=km.out$cluster)) (d) Using complete linkage, perform hierarchical clustering and color the points on the scatterplot matrix as in the previous question. Is the result much different? (Hint: In R, hc.complete=hclust(dist(tumor), method="complete") cutree(hc.complete,2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!