Assignment_1-1
Assignment_1-1
650 Assignment #1
Data Analytics Page 1 of 1
Dr. Ruxian Wang, Johns Hopkins Carey Business School
Assignment #1
All assignments should be submitted through our course website. Please submit two files: one file
(in format .pdf) includes your answers to all questions; the other file (in format .R) contains your R
commands. File names should be LastName FirstName AssignmentNumber, e.g., for Assignment
#1 your files should be named by “Wang Ruxian 1.docx” and “Wang Ruxian 1.R”.
(a) Download the software R and Rstudio and install it to your computer. You can find the
suitable version for your Operating System (Windows, Mac, Linux) at this link
http://www.cran.r-project.org/ and https://www.rstudio.com/products/rstudio/download/
(b) Read Chapters 1 to 8 of the manual: “An Introduction to R”, which can be found at
the link below
http://cran.r-project.org/doc/manuals/r-release/R-intro.pdf
(c) Repeat the examples in Chapters 1 to 8 of “An Introduction to R”.
3. This exercise involves the Auto data set, which can be downloaded at the BlackBoard. Make
sure that the missing values have been removed from the data.
(a) Which of the predictors are quantitative, and which are qualitative?
(b) What is the range of each quantitative predictor? You can answer this using the range()
function.
(c) What is the mean and standard deviation of each quantitative predictor?
(d) Now remove the 10th through 85th observations. What is the range, mean, and standard
deviation of each predictor in the subset of the data that remains? (Try to use R
commands to do so.)
(e) Using the full data set, investigate the predictors graphically, using scatterplots or other
tools of your choice. Create some plots highlighting the relationships among the predic-
tors. Comment on your findings.
(f) Suppose that we wish to predict gas mileage (mpg) on the basis of the other variables.
Do your plots suggest that any of the other variables might be useful in predicting mpg?
Justify your answer.