Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ggplot ( data = dairy _ queen, aes ( x = cal _ fat ) ) + geom _ blank ( ) + geom _

ggplot(data = dairy_queen, aes(x = cal_fat))+
geom_blank()+
geom_histogram(aes(y =..density..))+
stat_function(fun = dnorm, args = c(mean = dqmean, sd = dqsd), col = "tomato")
After initializing a blank plot with geom_blank(), the ggplot2 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions