STAT 516 Homework 1

Author

Your classmate

Published

January 28, 2026

hr <- c(80, 118, 92, 84, 78, 84, 
        76, 82, 76, 88, 108, 90, 
        90, 90, 86, 70, 68, 46, 
        98, 56, 84, 80, 78, 66, 60)

1)

qqnorm(hr)
qqline(hr)

2)

xbar <- mean(hr)
sn2 <- var(hr)
sn <- sd(hr)

The mean of the sample is X¯n=81.12, the variance is Sn2=238.6933, and the standard deviation is Sn=15.4497.

3)

For a sample with a known standard deviation, the confidence interval of the mean is found by the formula (1α)100% C.I.=X¯n±zα/2σn

alpha <- 1 - 0.99;
n <- length(hr);
sigma <- 16
MoE <- qnorm(1-alpha/2) * sigma / sqrt(n)

The 99% C.I. of the sample (σ=16) is 81.12±8.2427.

4)

For a sample with an unknown standard deviation (i.e., using Sn to estimate σ), the confidence interval of the mean is found by the formula (1α)100% C.I.=X¯n±tn1, α/2Snn

alpha <- 1 - 0.99
sn <- sd(hr)
MoE <- qt(1-alpha/2, n-1)*(sn/sqrt(n))

The 99% C.I. of the sample is 81.12±8.6424.

5)

The minimum number of samples needed to obtain a desired margin of error, M, is determined by the formula n=(zα/2σM)2

MoEs <- 2
alpha <- 1 - 0.95
sigma <- sd(hr)
n1 <- ceiling( (qnorm(1-alpha/2) * (sn/MoEs)) ^2 )

Using Sn=15.4497 to estimate σ, we find that number of samples needed is at least n=230.

6)

i)

H0:μ80 bpm H1:μ>80 bpm

ii)

Tstat=X¯nμ0Sn/n

mu0 <- 80
sn <- sd(hr)
ts <- (xbar - mu0) / (sn/sqrt(n) )

Tstat=0.3624665

iii)

For a one-sided test, Critical Value=tn1, α

alpha <- 0.05
tc <- qt(1-alpha, n-1)

tn1, α=1.7108821

iv)

We reject H0 if Tstat>tn1, α.

ts > tc
[1] FALSE

Tstattn1, α. Therefore, we fail to reject H0 and conclude that the mean heart rate of this population of students is not significantly greater than 80 bpm.

v)

For a right-tailed test, p=P(T>Tstat)

pval <- pt(-ts, n-1)

p=0.3600879

7)

i)

H0:μ=82 bpm H1:μ82 bpm

ii)

Tstat=X¯nμ0Sn/n

mu0 <- 82
ts <- (xbar - mu0) / (sn/sqrt(n) )

Tstat=0.2847951

iii)

For a two-sided test, Critical Value=tn1, α/2

alpha <- 0.10
tc <- qt(1-alpha/2, n-1)

tn1, α/2=1.7108821

iv)

We reject H0 if |Tstat|>tn1, α/2.

abs(ts) > tc
[1] FALSE

|Tstat|tn1, α/2.Therefore, we fail to reject H0 and conclude that the mean heart rate of this population of students is not significantly different from 82 bpm.

v)

For a two-tailed test, p=2P(T>|Tstat|)

pval <- 2*pt(-abs(ts), n-1)

p=0.7782442

8)

For a one-tailed test, n=σ2(zα+zβμμ0)2

sigma <- sd(hr)
alpha <- 0.05
beta <- 1 - 0.90
za <- qnorm(1-alpha)
zb <- qnorm(1-beta)
mus <- 77
mu0 <- 75
n_8 <- ceiling(sigma^2 * (za + zb)^2 / (mus - mu0)^2)

Given that the true mean of the sample is at least 77 bpm, the number of samples needed to confirm that μ>75 bpm at significance level α=0.05 and power γ=0.90 is n=512.

9)

For a two-tailed test, n=σ2(zα/2+zβμμ0)2

sigma <- sd(hr)
alpha <- 0.01
beta <- 1 - 0.80
za <- qnorm(1-alpha/2)
zb <- qnorm(1-beta)
mus <- 78+2
mu0 <- 78
n_9 <- ceiling(sigma^2 * (za + zb)^2 / (mus - mu0)^2)

Given that the true mean of the sample is at least 2 bpm from 78 bpm, the number of samples needed to confirm that μ78 bpm at significance level α=0.01 and power γ=0.80 is n=697.