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 Dataset using the read.csv() function.

# Store the NSCC student dataset in environment
nscc <- read.csv("nscc_student_data.csv")

Find the sample mean and sample size of the PulseRate variable in this dataset and answer the question that follows below.

# Mean pulse rate of this sample
mean(nscc$PulseRate, na.rm = TRUE)
## [1] 73.47368
# Find the sample size of pulse rates (hint: its how many non-NA values are there)
sum(!is.na(nscc$PulseRate))
## [1] 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
mn <- mean(nscc$PulseRate, na.rm = TRUE)
mn 
## [1] 73.47368
#Store sample size 
ss <- sum(!is.na(nscc$PulseRate))
ss 
## [1] 38
# Calculate lower bound of 90% CI
mn - 1.645*(14/sqrt(ss))
## [1] 69.73772
# Calculate upper bound of 90% CI
mn + 1.645*(14/sqrt(ss))
## [1] 77.20964
# Calculate lower bound of 95% CI
mn - 1.96*(14/sqrt(ss))
## [1] 69.02233
# Calculate upper bound of 95% CI
mn + 1.96*(14/sqrt(ss))
## [1] 77.92504
# Calculate lower bound of 99% CI
mn - 2.58*(14/sqrt(ss))
## [1] 67.61425
# Calculate upper bound of 99% CI
mn + 2.58*(14/sqrt(ss))
## [1] 79.33312

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().

#Calculate and store z-test comparing sample mean to 72 bpm
z <- (mn - 72)/ (14/sqrt(ss))
z
## [1] 0.6488857
# Calculate the p-value 
2*pnorm(abs(z), lower.tail = FALSE)
## [1] 0.5164123

Questions:

Question 5: Reflection

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