In: Math
You randomly select 20 coffee shops and measure the temperature of the coffee sold at each. The sample mean temperature is 162.0ºF with a sample standard deviation of 10.0ºF. Assume the temperatures are approximately normally distributed. Find the test statistic to test if population average temperature of the coffee is different than 163.5 F.
Solve using R
X:temperature of coffee
Given that X~N( ,) .......(parameters are known)
=mean=162.0ºF
=standard deviation =10.0ºF
n=sample size=20
Hypothesis is
H0: 0=163.5 F against H1: 0 163.5 F
R code to comupte test statistic is.
> xbar=163.5 #under H0 average
> mu=162 #mean
> sigma=10 #standard deviation
> n=20 #sample size
> z=(xbar-mu)/(sigma/sqrt(n)) #test statistic
> z
[1] 0.6708204
> zcritical=qnorm(0.975,0,1) #critical value
> zcritical
[1] 1.959964
Here Z=0.6708204 < Z critical=1.959964
accept null hypothesis 5% level of significance
Conclusion: average temperature of the coffee is may not different than 163.5 F.