asadoughi / stat-learning

Notes and exercise attempts for "An Introduction to Statistical Learning"
http://asadoughi.github.io/stat-learning
2.13k stars 1.62k forks source link

Question 10.7 #92

Open kevinlinke opened 6 years ago

kevinlinke commented 6 years ago

Thank you for writing up these solutions! They were very helpful to me. The answer to 10.7 is incorrect- the observations should be normalized by row rather than by column, which will yield a fixed ratio of 1/6. All that needs to change is your first line:

dsc = t(scale(t(USArrests))) a = dist(dsc)^2 b = as.dist(1 - cor(t(dsc))) summary(b/a)