In: Statistics and Probability
Use R studio.
Bacteria in water are counted as colony-forming units (CFU’s) per milliliter. Ten bottles of water are randomly selected for sampling, with the intention of testing if two different labs produce the same results. Each bottle is divided into two parts, and then given to each of the two labs:
Bottle |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Lab 1 |
875 |
959 |
475 |
589 |
925 |
1100 |
971 |
450 |
892 |
728 |
Lab 2 |
910 |
878 |
410 |
495 |
1021 |
980 |
1002 |
130 |
850 |
620 |
Test the hypothesis that the average value from lab 1 higher than that of lab two (a = 0.05). Hint: you can read the data in as vectors, e.g.:
lab1 = c(875,959,475,589,925,1100,971,450,892,728)
Part A
Yes
Since all ten bottles of water are selected randomly and then each bottle is divided into two parts which shows that both are equally likely to be tested in Lab 1 or lab 2 hance the ten observations from lab 1 are independent of lab 2.
Using R Studio
R Script
#Reading Obersvation of Lab1 and Lab2
lab1 = c(875,959,475,589,925,1100,971,450,892,728)
lab2 = c(910,878,410,495,1021,980,1002,130,850,620)#Null
Hypothesis
#H0: mean_lab1_value = mean_lab2_value
#H1: Mean_lab2_value ≠ mean_lab2-value
#For Test Statistic and P- value we will use T test for two means
t_test = t.test(x = lab1,y = lab2,alternative = "greater")
t_test
t_test$statistic
t_test$p.value
R output
> #Reading Obersvation of Lab1 and Lab2
> lab1 = c(875,959,475,589,925,1100,971,450,892,728)
> lab2 = c(910,878,410,495,1021,980,1002,130,850,620)
>
> #Null Hypothesis
> #H0: mean_lab1_value = mean_lab2_value
> #H1: Mean_lab2_value ≠ mean_lab2-value
>
> #For Test Statistic and P- value we will use T test for two
means
>
> t_test = t.test(x = lab1,y = lab2,alternative =
"greater")
> t_test
Welch Two Sample t-test
data: lab1 and lab2
t = 0.562, df = 16.611, p-value = 0.2908
alternative hypothesis: true difference in means is greater than
0
95 percent confidence interval:
-140.2514 Inf
sample estimates:
mean of x mean of y
796.4 729.6
>
> t_test$statistic
t
0.5619978
> t_test$p.value
[1] 0.2908111
Answer
What are the null and alternative hypotheses?
H0: The mean value of lab1 is equal to the mean value of lab2
H1: The mean value of lab1 is greater than the mean value of lab2
What are the test statistic and its p-value?
test statistic = 0.5619978
P-value = 0.2908111
What decision and conclusion should you make?
Since the p-value is greater than 0.05 hence there is not enough evidence to reject the null hypothesis.
Hence, we can conclude that the mean value of lab1 is equal to the mean value of lab2.