In: Statistics and Probability
1.The Springfield Water Treatment plant is constantly measuring the quality of their drinking water. The level of pH is one item that is measured by them, and the water treatment plant has a target pH of 8.2. In a recent test of 14 samples of water from the treatment plant, they found the following pH levels in their water: 8.6, 8.5, 9.1, 8.4, 8.1, 9.3, 8.8, 8.9, 9.3, 8.0, 8.7, 8.6, 8.7, 9.1 . Also assume that the pH level in the water is approximately normally distributed
PLEASE ANSWER THE FOLLOWING USING R STUDIO
a. Compute the p-value of your test statistic using the “pt()” function in R studio. Interpret this value with a complete sentence.
b.Use “t.test(X, alternative = “two.sided”, mu= 8.2)” on R studio to quickly verify your result from part a.
USING R STUDIO:
The Springfield Water Treatment plant is constantly measuring the quality of their drinking water. The level of pH is one item that is measured by them, and the water treatment plant has a target pH of 8.2. In a recent test of 14 samples of water from the treatment plant, they found the following pH levels in their water:
Also assume that the pH level in the water is approximately normally distributed
a) The p-value of our test statistic using the “pt()” function :
> x=c(8.6, 8.5, 9.1, 8.4, 8.1, 9.3, 8.8, 8.9, 9.3, 8.0, 8.7,
8.6, 8.7, 9.1)
> n=length(x)
> ts=((mean(x)-8.2))/sqrt(var(x)/n)
> ## Test Statistic:
> ts
[1] 4.873336
> p_value=pt(ts,df=n-1,lower.tail = FALSE)
> ## p-value:
> p_value
[1] 0.000152106
b) verification of our result from part a):
> t=t.test(x, alternative="two.sided", mu= 8.2)
> ## p-value:
> t$p.value
[1] 0.0003042119
> ## Test Statistic:
> t$statistic
t
4.873336
## p-value obtained by the function pt() using R studio is exactly half as compaired with the p-value obtained by t.test(x,alternative="two.sided", mu= 8.2).