Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ggplot ( data = dairy _ queen, aes ( x = cal _ fat ) ) + geom _ blank ( ) + geom _
ggplotdata dairyqueen, aesx calfat
geomblank
geomhistogramaesy density..
statfunctionfun dnorm, args cmean dqmean, sd dqsd col "tomato"
After initializing a blank plot with geomblank the ggplot package within the tidyverse allows us to add additional layers. The first layer is a density histogram. The second layer is a statistical function the density of the normal curve, dnorm. We specify that we want the curve to have the same mean and standard deviation as the column of calories from fat. The argument col simply sets the color for the line to be drawn. If we left it out, the line would be drawn in black.
Based on the this plot, does it appear that the data follow a nearly normal distribution?
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