# Investigate the data set women, which is # part of base R. ?women # A.  Use the function str() to list the class of the data set, #     the number of observations and variables, along with  #     the variable names and types # B.  List the first 10 lines of the data set # C.  Write an R function to calculate BMI rounded to one decimal place value. #     The formula for BMI is (weight / height^2)*703 #     Use the function, round(), to round the calculated BMI  #     to one decimal place value ?round() # D. Test your BMI function:  # for weight = 145 lbs, height = 64 inches (BMI should be 24.9) # for weight = 130 lbs, height = 66 (BMI should be 21) # E.  Calculate the BMI for the women in the data set, women and #     save these values in a new variable, bmi.   #     The new variable, bmi, should be a included as a new variable  #     in the data frame, women. #     Check:  Print the first and last 5 rows of the data frame, women # F.  Use the summary() function to find the Minimum, Quartile 1 (Q1),  #     Median/Quartile 2 (Q2), Quartile 3 (Q3) and Maximum values of bmi # G.  Convert the numeric variable, bmi, into the factor bmi.quartiles #     using the function cut( ) and the following values as  #     breaks: Minimum, Quartile 1 (Q1), Median/Quartile 2 (Q2),  #     Quartile 3 (Q3), Maximum #     The new variable, bmi.quartiles, should be included  #     as a new variable (column) in the women data frame #     NOTE:   Review Lecture 6 Class Notes -  #             Converting continuous variables to categorical variables ###   IMPORTANT NOTE:  Set the cut() function argument, include.lowest = TRUE ?cut() # CHECK:  That the variable, bmi.quartiles, has been computed correctly and #         added to the data frame, women # H.  Use the table( ) function to generate #     a frequency table for bmi.quartiles RSTUDIO

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

# Investigate the data set women, which is # part of base R. ?women # A.  Use the function str() to list the class of the data set, #     the number of observations and variables, along with  #     the variable names and types # B.  List the first 10 lines of the data set # C.  Write an R function to calculate BMI rounded to one decimal place value. #     The formula for BMI is (weight / height^2)*703 #     Use the function, round(), to round the calculated BMI  #     to one decimal place value ?round() # D. Test your BMI function:  # for weight = 145 lbs, height = 64 inches (BMI should be 24.9) # for weight = 130 lbs, height = 66 (BMI should be 21) # E.  Calculate the BMI for the women in the data set, women and #     save these values in a new variable, bmi.   #     The new variable, bmi, should be a included as a new variable  #     in the data frame, women. #     Check:  Print the first and last 5 rows of the data frame, women # F.  Use the summary() function to find the Minimum, Quartile 1 (Q1),  #     Median/Quartile 2 (Q2), Quartile 3 (Q3) and Maximum values of bmi # G.  Convert the numeric variable, bmi, into the factor bmi.quartiles #     using the function cut( ) and the following values as  #     breaks: Minimum, Quartile 1 (Q1), Median/Quartile 2 (Q2),  #     Quartile 3 (Q3), Maximum #     The new variable, bmi.quartiles, should be included  #     as a new variable (column) in the women data frame #     NOTE:   Review Lecture 6 Class Notes -  #             Converting continuous variables to categorical variables ###   IMPORTANT NOTE:  Set the cut() function argument, include.lowest = TRUE ?cut() # CHECK:  That the variable, bmi.quartiles, has been computed correctly and #         added to the data frame, women # H.  Use the table( ) function to generate #     a frequency table for bmi.quartiles RSTUDIO

Expert Solution
Algorithm
  1. Use the str() function to get information about the women dataset
  2. Use head() function to display the first 10 rows of the women dataset
  3. Define a function to calculate BMI using the formula: (weight / height^2)*703, and round the result to one decimal place using the round() function
  4. Test the BMI function using two sets of weight and height values
  5. Calculate the BMI for each woman in the dataset and add it as a new variable, bmi, to the women dataset
  6. Use the summary() function to get basic statistical information about the bmi variable in the women dataset
  7. Convert the bmi variable to a factor variable, bmi.quartiles, using the cut() function and specified breaks, and add it as a new variable to the women dataset
  8. Use the table() function to get a frequency table for the bmi.quartiles variable in the women dataset.
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Linked List Representation
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY