Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2 The objective of this question is to give practice building a plot that uses several optional arguments and low level functions, including a

image text in transcribed
Question 2 The objective of this question is to give practice building a plot that uses several optional arguments and low level functions, including a legend with mixed types of symbols. Create overlapping relative frequency histograms for the distributions of we ight split by the mother's smoker status (either smoker or nonsmoker). Be sure that the plot satisies the following criteria: . Change the zit-label and main title to be more informative. . Use different colors for the two histograms. Change the density of the shading so that the overlap between the histograms is visible. . Superimpose density curves of the data, matching the color of the curves to the corresponding histogram. . Add vertical lines that show the median weights for each distribution. . Add a legend that helps understand the various colors /components of the plot. Based on the plot, do you think there is a signicant dierence between the typical weight of a baby born to a mother who smokes and the typical weight of a baby born to a mother who does not smoke? Him I : For legends with mixed types of symbols (points, lines, boxes, etc.), the pch, lty, density, and border (and other) arguments use NA to exclude those arguments from modifying the corresponding entries in the legend (r111 uses 0 instead of NA). For example, a legend with two box entries and one line entry could have arguments density = c(20, 30, NA), border = C(l, 1, NA), and lty = C(NA, NA, 1). Hint 2: The boxes in the legend do not need to align or be centered perfectly with the lines

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

Classical Mechanics

Authors: R Douglas Gregory

1st Edition

0511159242, 9780511159244

More Books

Students also viewed these Mathematics questions