Question: Problem 2 Problem 2. For this exercise you will be using a subset of data collected from pregnancies that occured between 1960 and 1967 among
Problem 2
Problem 2. For this exercise you will be using a subset of data collected from pregnancies that occured between 1960 and 1967 among women in Oakland, California. First create a folder called STAT7000 and inside that folder create another folder called assignment2. Next change your working directory to the folder assignment and execute the following lines of code: website httpistat berkeley.edu/astatas/data/babi:23.data download. File(website, destillenables, sethodouto') A description of the variables in the data file is found here: https://instatat.berkeley, edu/-stations/data/bables,crase (a) Read the data into R and store it in the variable babies. Hint: Use the function read.table) or the import Dataset button. The values in the data file are separated by white space, that is one or more spaces, tabs, newlines or carriage returns th) What are the names of columns 1,7. 12. 13? Store columns 1.7. 12. 13 in the variable babies2. Only include the data for which the values in column 7 are less than 999, the values in column 12 are less than 99 and the values in 13 are less than 999. Hints: use the function subset() and names). te Change the variable names of babies 2 to "id" "baby.weight": "motherheight", "mother.weight: dd) Add another column to babies called "mother.bmi" which records the body mass index of the mother. Calculate the body mass index by using the mother's weight in kilograms divided by the square of her height in meters. Hint. Note the units of the variables "motherheight", "mother.weight" (el A person with a body mass index of 30 or more is classified as obese. How many mothers are obese? (n) Find the identification numbers of the ten mothers with the highest body mass index. Hint: use the function ordert). O RE 3 F4 F5 F6 F7 F8 F9 F10 FAN Problem 2. For this exercise you will be using a subset of data collected from pregnancies that occured between 1960 and 1967 among women in Oakland, California. First create a folder called STAT7000 and inside that folder create another folder called assignment2. Next change your working directory to the folder assignment and execute the following lines of code: website httpistat berkeley.edu/astatas/data/babi:23.data download. File(website, destillenables, sethodouto') A description of the variables in the data file is found here: https://instatat.berkeley, edu/-stations/data/bables,crase (a) Read the data into R and store it in the variable babies. Hint: Use the function read.table) or the import Dataset button. The values in the data file are separated by white space, that is one or more spaces, tabs, newlines or carriage returns th) What are the names of columns 1,7. 12. 13? Store columns 1.7. 12. 13 in the variable babies2. Only include the data for which the values in column 7 are less than 999, the values in column 12 are less than 99 and the values in 13 are less than 999. Hints: use the function subset() and names). te Change the variable names of babies 2 to "id" "baby.weight": "motherheight", "mother.weight: dd) Add another column to babies called "mother.bmi" which records the body mass index of the mother. Calculate the body mass index by using the mother's weight in kilograms divided by the square of her height in meters. Hint. Note the units of the variables "motherheight", "mother.weight" (el A person with a body mass index of 30 or more is classified as obese. How many mothers are obese? (n) Find the identification numbers of the ten mothers with the highest body mass index. Hint: use the function ordert). O RE 3 F4 F5 F6 F7 F8 F9 F10 FAN