
verification of work
Hi, looking for a verification of my answers for this questions: And if I did it wrong please tell me how to improve. Thanks!
Rick, the new manager of a trendy restaurant in Ottawa, has many questions about his customers and their preferences for dinnertime beverages. He carries out a random survey of 300 customers and obtains this twoway table of observed frequencies.
 Water  Soft Drink  Beer  Total 
2134 years  30  90  20  140 
3555 years  40  40  20  100 
Over 55 years  20  10  30  60 
Total  90  140  70  300 
Rick’s main question is about whether age and beverage preference within the restaurant’s customer population are related.
a) What is the name of the appropriate hypothesis test that should be used to answer this?
b) To carry out this test, fill in the following table of expected frequencies. Fill in the blanks in the “Water” column.
 Water  Soft Drink  Beer  Total 
2134 years   65.3  32.7  140 
3555 years   46.7  23.3  100 
Over 55 years   28.0  14.0  60 
Total  90  140  70  300 
c) State clearly the hypotheses to be tested.
Complete the test, using a 5% significance level, by determining the test statistic, giving the degrees of freedom, the critical value OR upper bound on a Pvalue, and a conclusion. You may use Minitab to calculate the test statistic but demonstrate you know how to calculate it manually by providing the manual calculations for the contribution of the cell "Water  2123 years" to the test statistic.
Answers:
a) The appropriate test to use is the chisquare test of independence.
b)
 Water  Soft Drink  Beer  Total 
2134 years  42  65.3  32.7  140 
3555 years  13  46.7  23.3  100 
Over 55 years  18  28.0  14.0  60 
Total  90  140  70  300 
c)
H0= Customer age and their beverage preference unrelated (independent)
Ha= Customer age and their beverage preference are related (dependent)
d)
x^2 = sum (Observed – Expected)^2 / Expected
(3042)^2 / 42 = 3.43
(9065.3)^2 / 65.3 = 9.34
(2032.7)^2 / 32.7 = 4.93
(4030)^2 / 30 = 3.33
(4046.7)^2 / 46.7 = 0.96
(2023.3)^2 / 23.3 = 0.47
(2018)^2 / 18 = 0.22
(1028)^2 / 28 = 11.57
(3014)^2 / 14 = 18.27
Summing the above, x^2 = 52.52
Degrees of freedom (Df) = (31)(31)=4
The corresponding pvalue for a test statistics of 52.52 with 4 degrees of freedom is approximately 0. This means we reject the null since 0 is < our alpha value of 0.05.

Re: verification of work
Hey dumbledore.
Your working looks OK, but as a suggestion for the future: you should probably post your data so that it can be evaluated in some kind of statistical package like R.
The reason is that checking all the calculations by hand are tedious and are prone to errors.
For this reason if you say posted the outputs and inputs of data into a package, it's much easier to verify since all we have to do is check the inputs and run the code on our machine to verify since the package is going to be the same and do the same thing.
I suspect that your results are right, but the only question I have is if you chose the independent contingency table to have a uniform distribution with respect to the frequencies in the table (I suspect you did this).
If you do the above, then it will be easier for other people to check and I guarantee that more people will want to check it since it will be easier on them to do so.