Suppose you run an experiment, and observe the following values: 12, 20, 34, 45, 34, 36, 37, 50, 11, 32, 29 You will test the hypothesis that the average was 25 at alpha=0.05. #5.1) Write out the Null and Alternative hypotheses. Conduct the hypothesis test assuming normality. Use the “t.test” function. Do you reject or fail to reject the null? Solve using R.
R CODE:
> # Let x denotes the values given
> x<-c(12,20,34,45,34,36,37,50,11,32,29)
> # Null hypothesis H0: average= 25
> # Alternative hypothesis H1: average is not equal to 25
> z<-t.test(x,alternative="two.sided",mu=25)
> z
OUTPUT:
One Sample t-test
data: x
t = 1.5881, df = 10, p-value = 0.1433
alternative hypothesis: true mean is not equal to 25
95 percent confidence interval:
22.61855 39.19963
sample estimates:
mean of x
30.90909
Result: Since P value > alpha, it implies that we fail to reject Ho at the alpha level of significance.
That means average = 25 according to the t-test.
Get Answers For Free
Most questions answered within 1 hours.