BTS 510 Lab 8

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.1     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.1
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
set.seed(12345)
theme_set(theme_classic(base_size = 16))

1 Learning objectives

  • Describe the logic of hypothesis testing
  • Interpret tests comparing one sample to hypothesized value
  • Relate hypothesis testing to confidence intervals
  • Recognize when to use a nonparametric test

2 Data

  • Pulse dataset from the Stat2Data package
    • A dataset with n = 232 observations on the following 7 variables.
      • Active: Pulse rate (beats per minute) after exercise
      • Rest: Resting pulse rate (beats per minute)
      • Smoke: 1=smoker or 0=nonsmoker
      • Sex: 1=female or 0=male
      • Exercise: Typical hours of exercise (per week)
      • Hgt: Height (in inches)
      • Wgt: Weight (in pounds)
  • Convert the factor variables to factor variables, as in the lecture
    • as.factor() function

3 Tasks

  • Make plots of variables as needed

3.1 Gender split

  • Is the gender split in this sample the same as in the total population (i.e., 50/50)?
    • What kind of variable is this?
    • What test should you do?
    • Directional or non-directional?
    • Present the results of the test
    • Write your conclusions: Is the gender split in this sample comparable to that in the total population?

3.2 Smoking rate

  • Is the smoking rate in this sample the same as the 11.5% rate in the US? (CDC info on smoking here
    • What kind of variable is this?
    • What test should you do?
    • Directional or non-directional?
    • Present the results of the test
    • Write your conclusions: Is the smoking rate in this sample comparable to the 11.5% rate in the US?

3.3 Elevated pulse rate

  • Is the active pulse rate higher than the high end of resting pulse rate of 100 bpm?
    • What kind of variable is this?
    • What test should you do?
    • Directional or non-directional?
    • Present the results of the test
    • Write your conclusions: Is the active pulse rate different from the high end of resting pulse rate of 100 bpm?

3.4 Height among men

  • Is the height of men in this sample different from the US average of 5 feet 9 inches?
    • What kind of variable is this?
    • What test should you do?
    • Directional or non-directional?
    • Present the results of the test
    • Write your conclusions: Is the height of men in this sample different from the US average of 5 feet 9 inches?