Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 The objective of this question is to give practice working with data frames and constructing basic graphics. (a) Read the dataset into R

image text in transcribed
Question 1 The objective of this question is to give practice working with data frames and constructing basic graphics. (a) Read the dataset into R and save it to the workspace. The categorical variables should be stored as factors. Verify that the data has been loaded correctly. Note: Do not print the entire data object. It is extremely bad practice/style to output more than about 10 rows of a matrix or data frame. (11) The Habit variable contains the smoker status for the mother of each baby in the sample. There are several observations in the data for which there is no information about the mother's smoker status. How many observations are in this category? What is the name of the category (level) in the Habit variable for these observations? (C) Create a bar plot of the mother's smoker status in the data. Change the color of the bars from the default grey color to a different color of your choice. (d) The droplevels 0 function drops unused levels from a factor or from factors in a data frame. Extract the observations in the data for which we know the mother's smoker status (either smoker or nonsmoker) and drop the unused level from the Habit variable. Save this subset of the data as a separate data frame in the workspace. The subset of the data should contain all of the variables from the original data. (6) Using the data frame from ((1), create side-byside boxplots of the weight variable split by the mother's smoker status

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

Discrete Mathematics With Applications

Authors: Susanna S Epp, Robert Gatewood,

4th Edition

1133168663, 9781133168669

More Books

Students also viewed these Mathematics questions

Question

Engage everyone in the dialogue

Answered: 1 week ago