Laboratory Activity #11
Kyla Angeline Balasico
2025-05-16
PROBLEM 1: A standardizes chemistry test was given to 50 girls and 75 boys. The girls made an average grade of 76 with a standard deviation of
66, while the boys made an average grade of 82 with a standard deviation of 8. Find a 96% confidence interval for the difference , where is the
mean score of all boys and is the mean score of all girls who might take this test.
# Data
n_girls <- 50
mean_girls <- 76
sd_girls <- 66
n_boys <- 75
mean_boys <- 82
sd_boys <- 8
# Confidence level
conf_level <- 0.96
alpha <- 1 - conf_level
# Standard error
se <- sqrt((sd_girls^2 / n_girls) + (sd_boys^2 / n_boys))
# Degrees of freedom (Welch-Satterthwaite approximation)
df <- ((sd_girls^2 / n_girls + sd_boys^2 / n_boys)^2) /
(((sd_girls^2 / n_girls)^2 / (n_girls - 1)) + ((sd_boys^2 / n_boys)^2 / (n_boys -
1)))
# Critical t-value
t_crit <- qt(1 - alpha/2, df)
# Confidence interval
diff_mean <- mean_boys - mean_girls
margin_error <- t_crit * se
lower <- diff_mean - margin_error
upper <- diff_mean + margin_error
cat("96% CI for μ_boys - μ_girls: [", round(lower, 2), ",", round(upper, 2), "]\n")
## 96% CI for μ_boys - μ_girls: [ -13.78 , 25.78 ]
PROBLEM 2 A course in mathematics is taught to 12 students by the conventional classroom procedure. A second group of 10 students was given
the same course by means of programmed materials. At the end of the semester the same examination was given to each group. The 12 students
meeting in the classroom made an average grade of 85 with a standard deviation of 4, while the 10 students using programmed materials made an
average of 81 with a standard deviation of 5. Find a 90% confidence interval for the difference between the population means, assuming the
populations are approximately normally distributed with equal variances.
# Data
n_classroom <- 12
mean_classroom <- 85
sd_classroom <- 4
n_programmed <- 10
mean_programmed <- 81
sd_programmed <- 5
# Confidence level
conf_level <- 0.90
alpha <- 1 - conf_level
# Pooled standard deviation
s_pooled <- sqrt(((n_classroom - 1) * sd_classroom^2 + (n_programmed - 1) * sd_programmed^
2) /
(n_classroom + n_programmed - 2))
# Standard error
se <- s_pooled * sqrt(1/n_classroom + 1/n_programmed)
# Degrees of freedom
df <- n_classroom + n_programmed - 2
# Critical t-value
t_crit <- qt(1 - alpha/2, df)
# Confidence interval
diff_mean <- mean_classroom - mean_programmed
margin_error <- t_crit * se
lower <- diff_mean - margin_error
upper <- diff_mean + margin_error
cat("90% CI for μ_classroom - μ_programmed: [", round(lower, 2), ",", round(upper, 2),
"]\n")
## 90% CI for μ_classroom - μ_programmed: [ 0.69 , 7.31 ]
PROBLEM 3 Records for the past 15 years have shown the average rainfall in a certain region of the country for the month of May to be 4.93
centimeters, with a standard deviation of 1.14 centimeters. A second region of the country has had an average rainfall in May of 2.64 centimeters
with a standard deviation of 0.66 centimeter during the past 10 years. Find a 95% confidence interval for the difference of the true average rainfalls
in these two regions, assuming that the observations come from normal populations with different variances.
# Data
n_region1 <- 15
mean_region1 <- 4.93
sd_region1 <- 1.14
n_region2 <- 10
mean_region2 <- 2.64
sd_region2 <- 0.66
# Confidence level
conf_level <- 0.95
alpha <- 1 - conf_level
# Standard error
se <- sqrt((sd_region1^2 / n_region1) + (sd_region2^2 / n_region2))
# Degrees of freedom
df <- ((sd_region1^2 / n_region1 + sd_region2^2 / n_region2)^2) /
(((sd_region1^2 / n_region1)^2 / (n_region1 - 1)) + ((sd_region2^2 / n_region2)^2 /
(n_region2 - 1)))
# Critical t-value
t_crit <- qt(1 - alpha/2, df)
# Confidence interval
diff_mean <- mean_region1 - mean_region2
margin_error <- t_crit * se
lower <- diff_mean - margin_error
upper <- diff_mean + margin_error
cat("95% CI for μ_region1 - μ_region2: [", round(lower, 2), ",", round(upper, 2), "]\n")
## 95% CI for μ_region1 - μ_region2: [ 1.54 , 3.04 ]