4.15 Chapter 4 Review Questions 2

NutritionStudy contains data for 315 patients at a hospital 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):

  Age Vitamin Calories  Fat Fiber Alcohol Cholesterol Gender EverSmoke
1  64       1   1298.8 57.0   6.3     0.0       170.3 Female    Former
2  76       1   1032.5 50.1  15.8     0.0        75.8 Female     Never
3  38       2   2372.3 83.6  19.1    14.1       257.9 Female    Former
4  40       3   2449.5 97.5  26.5     0.5       332.6 Female    Former
5  72       1   1952.1 82.6  16.2     0.0       170.8 Female     Never
6  40       3   1366.9 56.0   9.6     1.3       154.6 Female    Former
require(coursekata) # run your code here

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

Now let's look at some data from SleepStudy:

  Gender LarkOwl NumEarlyClass  GPA ClassesMissed CognitionZscore
1      0 Neither             0 3.60             0           -0.26
2      0 Neither             2 3.24             0            1.39
3      0     Owl             0 2.97            12            0.38
4      0    Lark             5 3.76             0            1.39
5      0     Owl             0 3.20             4            1.22
6      1 Neither             0 3.50             0           -0.04
  PoorSleepQuality DepressionScore Stress Happiness AllNighter
1                4               4 normal        28          0
2                6               1 normal        25          0
3               18              18 normal        17          0
4                9               1 normal        32          0
5                9               7 normal        15          0
6                6              14   high        22          0
  • Gender 1=male, 0=female
  • LarkOwl Early riser or night owl? Lark, Neither, or Owl
  • NumEarlyClass Number of classes per week before 9am
  • GPA Grade point average (0-4 scale)
  • ClassesMissed Number of classes missed in a semester
  • CognitionZscore Summary of performance on cognitive skills tests (continuous scores ranging from -1 to +1)
  • PoorSleepQuality Measure of sleep quality (higher values are poorer sleep)
  • DepressionScore Measure of degree of depression
  • Stress Coded stress score: normal or high
  • Happiness Measure of degree of happiness (higher values are happier)
  • AllNighter Had an all-nighter this semester? 0 or 1

require(coursekata) # run your code here
require(coursekata) # run your code here
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