Question: Question 7 In this question, you are asked to plot some histograms and kernel density estimates. We will use the mpg dataset that is available

Question 7
In this question, you are asked to plot some histograms and kernel density estimates. We will use the mpg dataset that is
available in the ggplot2 library (you likely saw this dataset in DAT 301 already). Run the following cell to load the
ggplot2 library and preview the first few rows of mpg :
In [58]: library(ggplot2)
head (mpg)
A tibble: 611
Part a)
Create a histogram, with appropriate breaks and x- and y-limits, for the hwy column of mpg. Additionally, create and plot
three kernel density estimations (KDEs) of the distribution of hwy : Use a gaussian kernel and bandwidths of 0.5,1,
and 2.5. Your final plot should resemble the following:
Histoaram of hwv variable
Hist
-BW=0.5
-,BW=1
BW=2.5
 Question 7 In this question, you are asked to plot some

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!