Provide a document that contains your answers, R code, code output and com-mentson the code output. Comment each line of your R code as well. Give thorough explanations throughout.
Exercise 1. (75 points) For this exercise, download the ?le Assignment1_data1 .csv and create a data frame called Data1.
I. Consider the following ?gure constructed from the dataset Data1.
Figure 1. Some box plots
a) Write the R code to reproduce that ?gure.
b) What are the conditioning variables in those plots? Give a thorough interpreta-tion.
II. Consider another ?gure constructed from the same dataset.
Figure 2. Some histograms
a) Write the R code to reproduce that ?gure.
b) Describe the distributional information that lies behind each histogram.
III. Consider the following prediction models:
a) Predict Y given Z.
b) Predict Y given X .
c) Predict Y given X and Z.
d) Predict Y given X , Z, and XZ. (XZ stands for the “product” of X and Z and is called an interaction variable.)
Given X=2.7, and Z=“B”, give the prediction for each of the 4 models (the use of the function predict is not allowed in this question).
IV. Write R code to reproduce the following plot. Interpret what the plot represents.
Figure 3. Some regression output plot