To be completed with code from R Studio. No additional information provided.
In AU supermarkets, the average weight of a banana is 119.9 grams. An agricultural scientist buys bananas from a supermarket. Their weight, in grams, is as follows:
c(113.9, 90.5, 93.9, 113.4, 101, 76.4)
She suspects that this sample of bananas is lighter than average and wonders if this supermarket is selling bananas that are lighter than the AU average.
(a) State a sensible null hypothesis
(b) State the precise definition of p-value and explain what “more extreme” means in this context
(c) Is a one-sided or two-sided test needed? justify
(d) Perform a student t-test using R and interpret
(e) Perform a Z test and account for any differences you find
Solution-:
Given data: , n=6
By using RStudio:
> # Hypothesis
> #(a) Null Hypothesis Ho: The average weight of a bananasis
119.
> #Vs
> # Alternative Hypothesis H1: The average weight of a bananas
is lighter than 119.
> #(d) mu=119.9
> x=c(113.9,90.5,93.9,113.4,101,76.4);x
[1] 113.9 90.5 93.9 113.4 101.0 76.4
> t.test(x,mu=119.9,conf.level=0.95,alt="l")
One Sample t-test
data: x
t = -3.6913, df = 5, p-value = 0.007064
alternative hypothesis: true mean is less than 119.9
95 percent confidence interval:
-Inf 110.0384
sample estimates:
mean of x
98.18333
(c) This is one sided, beacuse alternative hypothesis is left tailed.
(b) The P-value is the probability of a larger effect than what was observed.
Here, P-value= 0.007064 is less than level of significance =0.05 so we reject the null hypothesis.
(e) Here, is unkown so we can not perform or apply Z- test.
RStudio Code:
# Hypothesis
#(a) Null Hypothesis Ho: The average weight of a bananasis
119.
#Vs
# Alternative Hypothesis H1: The average weight of a bananas is
lighter than 119.
#(d) mu=119.9
x=c(113.9,90.5,93.9,113.4,101,76.4);x
t.test(x,mu=119.9,conf.level=0.95,alt="l")
To be completed with code from R Studio. No additional information provided. In AU supermarkets, the...