Please use the R program Use R to solve the following problem. A pH level of the
ID: 3290451 • Letter: P
Question
Please use the R program
Use R to solve the following problem. A pH level of the soil between 5.3 and 6.5 is optimal for strawberries. To measure the pH level, a field is divided into two lots. In each lot, we randomly select 20 samples of soil. (b) Using a statistical software, asses the assumption that the two populations have equal variance. (c) Test the hypothesis H_0: mu_1 = mu_2 against H_0: mu_1 notequalto mu_2, where mu_1 is the mean pH level of the soil in lot 1, and mu_2 is the mean pH level of the soil in lot 2. State your conclusion. Use level alpha = 0.10. (d) Give a 90% confidence interval for the difference mu_1 - mu_2, where mu_1 is the mean pH level of the soil in lot 1, and mu_2 is the mean pH level of the soil in lot 2. Using this interval, can we say that there is enough evidence that the average amount of pH level of the soil is different in two lots?Explanation / Answer
Lot1=c(5.66,5.73,5.68,5.77,5.73,5.71,5.68,5.58,6.11,5.37,5.67,5.53,5.59,5.94,
5.84,5.53,5.64,5.73,5.30,5.65)
Lot2=c(5.25,6.73,6.25,5.21,5.63,6.41,5.89,6.76,5.13,5.64,5.94,6.16,5.64,
6.54,5.79,5.91,6.17,6.90,5.76,6.07)
## b)
var.test(Lot1,Lot2)
# c)
t.test(Lot1,Lot2, conf.level = 0.10)
The value confidence interval of mu1-mu2 is include im the output of c).
Now, the output is
> Lot1=c(5.66,5.73,5.68,5.77,5.73,5.71,5.68,5.58,6.11,5.37,5.67,5.53,5.59,5.94,
+ 5.84,5.53,5.64,5.73,5.30,5.65)
>
> Lot2=c(5.25,6.73,6.25,5.21,5.63,6.41,5.89,6.76,5.13,5.64,5.94,6.16,5.64,
+ 6.54,5.79,5.91,6.17,6.90,5.76,6.07)
>
> ## b)
> var.test(Lot1,Lot2)
F test to compare two variances
data: Lot1 and Lot2
F = 0.12084, num df = 19, denom df = 19, p-value = 2.566e-05
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.04782803 0.30528411
sample estimates:
ratio of variances
0.1208352
>
> # b)
> t.test(Lot1,Lot2, conf.level = 0.10)
Welch Two Sample t-test
data: Lot1 and Lot2
t = -2.6196, df = 23.526, p-value = 0.01516
alternative hypothesis: true difference in means is not equal to 0
10 percent confidence interval:
-0.3323716 -0.3016284
sample estimates:
mean of x mean of y
5.672 5.989