Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3 Create a graphic of mean weight of the child versus year, which includes separate lines for the two top race categories, white and

Question 3
Create a graphic of mean weight of the child versus year, which includes separate lines for the two top race categories, white and black, coded as 1 and 2, respectively. The graphic should look like the following. Notice that the legend is different from the default legend. You'll want to investigate scale_color_discrete This section will use the `BirthDataWithRegionColors.csv` data set. This contains data about births in the United States, collected by the Centers for Disease Control (CDC). The variables in the data-set a is subset of the variables in the full data set, and the observations represent a "small" sample (chosen at random) of slightly over one million record
Variable | Description
---------|------------
`year`| the year of the birth
`month`| the month of the birth
`state`| the state where the birth occurred, including "DC" for Washington D.C.
`is_male`| which is `TRUE` if the child is male, `FALSE` otherwise
`weight_pounds`| the child's birth weight in pounds
`mother_age`| the age of the mother
`child_race`| race of the child.
`plurality`| the number of children born as a result of the pregnancy, with 1 representing a single birth, 2 representing twins, etc.
Combine `dplyr`with `ggplot2` to create graphical displays of the data. Use `filter`,`group_by`, and `summarize` to build the required data frame.
WHAT TO FIND:
Create a graphic of mean weight of the child versus year, which includes separate lines for the two top race categories, white and black, coded as 1 and 2, respectively.
year month state is_male weight_pounds mother_age child_race plurality region state_color
19692 CA TRUE 6.999676819201 NA West blue
19693 CA FALSE 6.876217952252 NA West blue
19695 CA TRUE 7.187069741301 NA West blue
19695 CA FALSE 7.749248509171 NA West blue
19695 CA TRUE 7.374462664224 NA West blue
19696 CA TRUE 9.625382359262 NA West blue
19698 CA FALSE 7.936641432261 NA West blue
19698 CA FALSE 6.499227484191 NA West blue
196911 CA FALSE 9.063203591251 NA West blue
196911 CA FALSE 7.625789643262 NA West blue
196911 CA FALSE 7.687519076261 NA West blue
19693 CT FALSE 6.311834561311 NA Northeast blue
19693 CT TRUE 6.250105128281 NA Northeast blue
19696 CT TRUE 7.813182565241 NA Northeast blue
19697 CT TRUE 6.686620406201 NA Northeast blue
196910 CT TRUE 8.187968411231 NA Northeast blue
19693 DC FALSE 7.561855587231 NA South blue
19698 DC FALSE 6.375768617192 NA South blue
196911 DC FALSE 6.999676819212 NA South blue
196911 DC FALSE 7.687519076222 NA South blue
19691 IL TRUE 7.500126153251 NA Midwest blue
19696 IL FALSE 6.499227484301 NA Midwest blue
19695 IL TRUE 8.811876612242 NA Midwest blue
19697 IL FALSE 4.812691179182 NA Midwest blue
19697 IL FALSE 7.561855587271 NA Midwest blue
196912 IL TRUE 7.125340308261 NA Midwest blue
19691 IL FALSE 8.688417745211 NA Midwest blue
19698 IL FALSE 8.000575488301 NA Midwest blue
19692 MD FALSE 7.125340308252 NA South blue
19699 MD FALSE 1.062628103261 NA South blue
19691 MA TRUE 5.875319282241 NA Northeast blue
image text in transcribed

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

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

Students also viewed these Databases questions