Purpose – Are North Shore Students Different?

In this project, students will demonstrate their understanding of the normal distribution, sampling distributions, confidence intervals and hypothesis tests to determine if NSCC students differ from typical averages or if any differences are just due to random variation.


Question 1: Sample v. Population

Tasks:

Load and store the sample NSCC Student Data set using the read.csv() function.

# Store the NSCC student data set in environment
 nscc_student_data <- read.csv("C:/Users/aless/Downloads/nscc_student_data.csv")

Find the sample mean and sample size of the Pulse Rate variable in this data set and answer the question that follows below.

# Mean pulse rate of this sample
mean(nscc_student_data$PulseRate, na.rm = TRUE)
## [1] 73.47368
# Find the sample size of pulse rates (hint: its how many non-NA values are there)
table(is.na(nscc_student_data$PulseRate))
## 
## FALSE  TRUE 
##    38     2

The mean pulse rate approximately 73.47 and the sample size is 38.

Questions:

Question 2: Confidence Intervals

Task: Construct 90%, 95%, and 99% Confidence Intervals for the mean pulse rate of all NSCC students. Assume that σ = 14.

# Store mean
pulsemean <- mean(nscc_student_data$PulseRate, na.rm = TRUE)

#Calculate lower bound of 90% CI
pulsemean - 1.65*(14/sqrt(38))
## [1] 69.72637
# Calculate upper bound of 90% CI
pulsemean + 1.65*(14/sqrt(38))
## [1] 77.221
# Calculate lower bound of 95% CI
pulsemean - 1.96*(14/sqrt(38))
## [1] 69.02233
# Calculate upper bound of 95% CI
pulsemean + 1.96*(14/sqrt(38))
## [1] 77.92504
# Calculate lower bound of 99% CI
pulsemean - 2.58*(14/sqrt(38))
## [1] 67.61425
# Calculate upper bound of 99% CI
pulsemean + 2.58*(14/sqrt(38))
## [1] 79.33312

The 90% confidence interval is 69.7 to 77.2

The 95% confidence interval is 69.0 to 77.9

The 99% confidence interval is 67.6 to 79.3

Questions:

Question 3: Hypothesis Testing with a Confidence Interval

Consider the national average pulse rate for US adults to be 72 bpm. Let’s test the claim that NSCC students differ from that national average.

\(H_0: \mu = 72\)
\(H_A: \mu \neq 72\)

Tasks:

Questions:

Question 4: Hypothesis Testing with a P-value

Task: Recall the sample data you got in question 1. For the hypotheses in question 3, compute the test statistic of that sample data and the p-value using pnorm().

#This code allows us to compute the p-value of our sample data
pnorm(73.47, 72, 14/sqrt(38), lower.tail = FALSE)*2
## [1] 0.5174614

Questions:

Question 5: Reflection

If you repeated this study of collecting NSCC students’ pulse rates to determine if they differ from the national average: