Question: Problem 2: The Davis data set in the car package contains recorded weight (kg), recorded height (cm), reported weight (kg), reported height (cm), and sex

 Problem 2: The Davis data set in the car package contains

Problem 2: The Davis data set in the car package contains recorded weight (kg), recorded height (cm), reported weight (kg), reported height (cm), and sex assigned at birth for each subject of a study. (a) Subset the recorded weight and reported weight columns and save them in a data frame named weight .metric. Print the rst few rows. (b) Convert the weights in weight.metric to pounds (1 kg = 2.2 lbs) anI name the resulting data frame weight. imp. Print the rst few rows. (c) Subset the recorded height and reported height columns and save them in a data frame named height .metric. Print the rst few rows. (d) Convert the heights in height.metric to inches rounded to one decimal (2.54 cm = 1 inch) and name the resulting data frame height. imp. Print the rst few rows. (e) Combine the sex assigned at birth information with all of the imperial weight and height information in a data frame named Davis . imp with column names sex, rec .weight, rep.weight, rec.height, and rep.height. Print the rst few rows. (f) Determine the number of missing values (NA) in each column of the Davis. imp data. (g) How many rows of the Davis . imp data contain a missing value. Note: Do not make assumptions. (h) Subset the vector containing sex assigned at birth of the subjects with a missing value in any column

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!