Question: Setting up Load tidyverse, which includes dplyr , ggplot2, tidyr , and other packages, and the load knitr. library (tidyverse) library(knitr) Read in the data


Setting up Load tidyverse, which includes dplyr , ggplot2, tidyr , and other packages, and the load knitr. library (tidyverse) library(knitr) Read in the data and convert the data frame to a tibble. birth_data 1969, 1969, 1969, 1969, 1969, 1969, 1969, 1969, ... $ month 9, 8, 9, 2, 3, 5, 5, 5, 6, 8, 8, 11, 11, 11, 1, ... $ state AL, AZ, AZ, CA, CA, CA, CA, CA, CA, CA, CA, CA, ... $ is male FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRU... $ weight_pounds 1.624807, 7.500126, 8.937540, 6.999677, 6.876218... $ mother_age 20, 35, 17, 20, 25, 30, 17, 22, 26, 26, 19, 25, ... $ child_race 2, 1, 1, 1, 2, 1, 1, 4, 2, 1, 1, 1, 2, 1, 1, 1, ... $ plurality NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ... Question 1 Create a variable called region in the data frame birth_data which takes the values Northeast, Midwest , South , and West. Here are the states in each region: Northeast Region: Connecticut, Maine, Massachusetts, New Hampshire, Rhode Island and Vermont, New Jersey, New York, and Pennsylvania Midwest Region: Illinois, Indiana, Michigan, Ohio and Wisconsin, lowa, Kansas, Minnesota, Missouri, Nebraska, North Dakota, and South Dakota South Region: Delaware, District of Columbia, Florida, Georgia, Maryland, North Carolina, South Carolina, Virginia, and West Virginia, Alabama, Kentucky, Mississippi, and Tennessee, Arkansas, Louisiana, Oklahoma, and Texas West Region: Arizona, Colorado, Idaho, Montana, Nevada, New Mexico, Utah and Wyoming, Alaska, California, Hawaii, Oregon and Washington Classes 'tbl_df', 'tbl' and 'data.frame': 1103629 obs. of 9 variables: $ year int 1969 1969 1969 1969 1969 1969 1969 1969 1969 1969 $ month int 989 2 3 5 5 5 6 8 ... $ state Factor w/ 51 levels "AK","AL", "AR",..: 2 4 4 5 5 5 5 5 5 5 ... logi FALSE TRUE TRUE TRUE FALSE TRUE ... $ weight_pounds: num 1.62 7.5 8.94 7 6.88 ... : int 20 35 17 20 25 30 17 22 26 26 ... $ child_race int 2 1 1 1 2 1 1 4 21... $ plurality : int NA NA NA NA NA NA NA NA NA NA ... $ region : chr "South" "South" "South" "South" ... Setting up Load tidyverse, which includes dplyr , ggplot2, tidyr , and other packages, and the load knitr. library (tidyverse) library(knitr) Read in the data and convert the data frame to a tibble. birth_data 1969, 1969, 1969, 1969, 1969, 1969, 1969, 1969, ... $ month 9, 8, 9, 2, 3, 5, 5, 5, 6, 8, 8, 11, 11, 11, 1, ... $ state AL, AZ, AZ, CA, CA, CA, CA, CA, CA, CA, CA, CA, ... $ is male FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRU... $ weight_pounds 1.624807, 7.500126, 8.937540, 6.999677, 6.876218... $ mother_age 20, 35, 17, 20, 25, 30, 17, 22, 26, 26, 19, 25, ... $ child_race 2, 1, 1, 1, 2, 1, 1, 4, 2, 1, 1, 1, 2, 1, 1, 1, ... $ plurality NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ... Question 1 Create a variable called region in the data frame birth_data which takes the values Northeast, Midwest , South , and West. Here are the states in each region: Northeast Region: Connecticut, Maine, Massachusetts, New Hampshire, Rhode Island and Vermont, New Jersey, New York, and Pennsylvania Midwest Region: Illinois, Indiana, Michigan, Ohio and Wisconsin, lowa, Kansas, Minnesota, Missouri, Nebraska, North Dakota, and South Dakota South Region: Delaware, District of Columbia, Florida, Georgia, Maryland, North Carolina, South Carolina, Virginia, and West Virginia, Alabama, Kentucky, Mississippi, and Tennessee, Arkansas, Louisiana, Oklahoma, and Texas West Region: Arizona, Colorado, Idaho, Montana, Nevada, New Mexico, Utah and Wyoming, Alaska, California, Hawaii, Oregon and Washington Classes 'tbl_df', 'tbl' and 'data.frame': 1103629 obs. of 9 variables: $ year int 1969 1969 1969 1969 1969 1969 1969 1969 1969 1969 $ month int 989 2 3 5 5 5 6 8 ... $ state Factor w/ 51 levels "AK","AL", "AR",..: 2 4 4 5 5 5 5 5 5 5 ... logi FALSE TRUE TRUE TRUE FALSE TRUE ... $ weight_pounds: num 1.62 7.5 8.94 7 6.88 ... : int 20 35 17 20 25 30 17 22 26 26 ... $ child_race int 2 1 1 1 2 1 1 4 21... $ plurality : int NA NA NA NA NA NA NA NA NA NA ... $ region : chr "South" "South" "South" "South