In: Statistics and Probability
Data:
sample volume
1 15.5
2 16.6
3 15.5
4 16.1
5 14.4
A bottling company claims that the mean amount of fluid in its beverage bottles is 16 oz. It's known that the amount of fluid is normally distributed. The amount of fluid of a sample of 9 nine bottles is shown above:
a) Test the company's claim at a .05 level of significance What is the value of the statistic?
b) Calculate a 94% Lower Confidence bound (1-sided) for the mean amount of fluid.
c) What minimum sample size is needed to detect a shift equal to 1 standard deviation, if the required power is .99 and the level of significance is .01
Assume we want a two-sided test.
Solve using R studio, must include code
6 15.7
7 15.4
8 14.5
9 15.5
----------------------R code--------------
vol=c(15.5,16.6,15.5,16.1,14.4,15.7,15.4,14.5,15.5)
n=9
test=t.test(vol,mu=16)
test
ci94=t.test(vol,mu=16,conf.level = 0.94)
ci94
alpha=0.01
#Shift of size 1 sd, so denominator = 1
min_sample_size=((qt(1-0.5*alpha,n-1))^2)*var(vol)
min_sample_size
-------------------------------------OUTPUT
vol=c(15.5,16.6,15.5,16.1,14.4,15.7,15.4,14.5,15.5)
> n=9
> test=t.test(vol,mu=16)
> test
One Sample t-test
data: vol
t = -2.3154, df = 8, p-value = 0.04927
alternative hypothesis: true mean is not equal to 16
95 percent confidence interval:
14.93551 15.99783
sample estimates:
mean of x
15.46667
> ci94=t.test(vol,mu=16,conf.level = 0.94)
> ci94
One Sample t-test
data: vol
t = -2.3154, df = 8, p-value = 0.04927
alternative hypothesis: true mean is not equal to 16
94 percent confidence interval:
14.96242 15.97091
sample estimates:
mean of x
15.46667
> alpha=0.01
> #Shift of size 1 sd, so denominator = 1
> min_sample_size=((qt(1-0.5*alpha,n-1))^2)*var(vol)
> min_sample_size
[1] 5.375993
------------------------------------
a) From the t test at 5% level, p value obatined is 0.04927 which is less than 0.05, hence we reject the claim that mean amount of claim in beverage bottle is 16 oz
b) 94% CI for mean amount of fluid is (14.96242, 15.97091)
c) minimum sample size needed is 5.37 and hence 6