Question
You should write R code anywhere you see an empty R code chunk. You should write English text anywhere you see ...; please surround it
You should write R code anywhere you see an empty R code chunk. You should write English text anywhere you see "..."; please surround it with doubled asterisks (`**...**`) so that it will show up as boldface and be easy for us to find. Include reasonable labels (titles, axis labels, legends, etc.) with each of your graphs. We'll use data on housing values in suburbs of Boston. They are in an R package called "MASS." (An R package is a collection of code, data, and documentation. "MASS" refers to the book "Modern Applied Statistics with S." R developed from the earlier language, S.) The MASS package comes with the default R installation, so it's already on your computer. However, it's not loaded into your R session by default. So we'll load it via the `require()` command (there's nothing for you to do here): ```{r} require("MASS") ``` Run `?Boston` (outside this R Markdown document) to read the help page for the `Boston` data frame.
Look into the highest-crime neighborhood by making a single graph of one column of three rows: * Find the row number, r, of the neighborhood with the highest "crim". * Make a density plot of "crim". Include a rug to show the data. * Add a red circle at (x, y) = (max crime rate, 0) to make this maximum crime rate stand out. * Make a density plot with rug of "medv", adding a red circle at (x, y) = (medv[r], 0) to see what medv corresponds to the highest crime rate. * Repeat the last step for "ptratio". ```{r} ``` What do you notice about the ptratio and medv for the highest-crime neighborhood?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started