-
Book Overview & Buying
-
Table Of Contents
Applied Unsupervised Learning with R
By :
Solution:
Before starting our main analysis, we will remove one variable that will not be relevant to us:
Boston<-Boston[,-12]
We will create dummy variables. We will end up with one original dataset, and one dummy variable dataset. We do that as follows:
Boston_original<-Boston
Next, we will create dummy variables for each of the measurements in the original dataset. You can find out the meaning of each of the variables in the dataset in the documentation of the MASS package, available at https://cran.r-project.org/web/packages/MASS/MASS.pdf.
Create dummy variables for whether a town has high or low crime per capita:
Boston$highcrim<-1*(Boston$indus>median(Boston$crim)) Boston$lowcrim<-1*(Boston$indus<=median(Boston$crim))
Create dummy variables for whether a town has a high or low proportion of land zoned for lots over 25,000 feet:
Boston$highzn<-1*(Boston$zn>median(Boston...
Change the font size
Change margin width
Change background colour