5.12 Chapter 5 Review Questions 2

NutritionStudy contains data for 315 hospital patients who had a noncancerous growth removed through surgery. It includes the following variables:

  • ID ID number for each subject in this sample
  • Age Subject's age (in years)
  • Vitamin Vitamin use: 1=Regular, 2=Occasional, or 3=No
  • Calories Number of calories consumed per day
  • Fat Grams of fat consumed per day
  • Fiber Grams of fiber consumed per day
  • Alcohol Number of alcoholic drinks consumed per week
  • Cholesterol Cholesterol consumed per day, in mg
  • Gender Coded as Female or Male
  • EverSmoke Smoking status: Never, Former, or Current 

Here's the result from running head(NutritionStudy):

Data frame output
row Age Vitamin Calories Fat Fiber Alcohol Cholesterol Gender EverSmoke
16411298.857.06.30.0170.3FemaleFormer
27611032.550.115.80.075.8FemaleNever
33822372.383.619.114.1257.9FemaleFormer
44032449.597.526.50.5332.6FemaleFormer
57211952.182.616.20.0170.8FemaleNever
64031366.956.09.61.3154.6FemaleFormer
require(coursekata) # run your code here
require(coursekata) # run your code here
require(coursekata) # run your code here

StudentSurvey is a data frame with 362 observations on the following 17 variables:

  • Year Year in school
  • Gender Student's gender: F or M
  • Smoke Smokers? No or Yes
  • Award Preferred award: Academy, Nobel, or Olympic
  • HigherSAT Which SAT is higher? Math or Verbal
  • Exercise Hours of exercise per week
  • TV Hours of TV viewing per week
  • Height Height (in inches)
  • Weight Weight (in pounds)
  • Siblings Number of Siblings
  • BirthOrder Birth order, 1 = oldest
  • VerbalSAT Verbal SAT score
  • MathSAT Math SAT score
  • SAT Combined Verbal + Math SAT
  • GPA College grade point average
  • Pulse Pulse rate (beats per minute)
  • Piercings Number of body piercings

require(coursekata) # run your code here
require(coursekata) # run your code here
require(coursekata) # run your code here
require(coursekata) # run your code here

Responses