1.

The following sample data shows the use of plastic (debit and credit) cards versus
cash/cheque by four age groups:
Age Group 18-24, 25-34, 35-44, 45 and over
Payment Method
plastic 21, 27, 27, 36
cash or cheque 21, 36, 42, 90

Test for independence between method of payment and age group. Use the p-value approach
and α = 0.05. To make it easier to compare answers, please round off to two decimal places.

2. Consider the following effects of three treatments
A B C
23 33 25
34 25 23
26 35 32
33 29 35
24 32 22
24 26 34
22 26 29
31 33 36
32 33
31 35
mean 27.1 30.2 30.4
Sample Standard deviation 4.8 3.5 5.3
At α = 0.05 is there a significant difference between the treament means? To make our
numbers easier to compare, you can round off the overall mean to one decimal place. Don’t
forget to provide an ANOVA table

Please help, really struggling

I can help you with both questions! Let's start with the first one.

1. To test for independence between method of payment and age group, you can use a chi-squared test. The null hypothesis is that there is no association between the two variables, and the alternative hypothesis is that there is an association.

To perform the test, you need to calculate the expected frequencies for each cell in the contingency table.

First, calculate the row totals and column totals for the observed frequencies:

Age Group | Plastic | Cash/Cheque | Row Total
----------------------------------------------
18-24 | 21 | 21 | 42
25-34 | 27 | 36 | 63
35-44 | 27 | 42 | 69
45 and over | 36 | 90 | 126
Column Total | 111 | 189 | 300

Next, calculate the expected frequencies using the formula:

Expected Frequency = (row total * column total) / grand total

Expected frequencies:

Age Group | Plastic | Cash/Cheque
-------------------------------------
18-24 | 13.86 | 28.14
25-34 | 22.05 | 40.95
35-44 | 23.31 | 45.69
45 and over | 51.78 | 74.22

Now, you can use these observed and expected frequencies to calculate the chi-squared statistic:

chi-squared = Σ[(observed frequency - expected frequency)^2 / expected frequency]

Calculate the chi-squared value using the formula and the values from the contingency table.

Degrees of freedom: (number of rows - 1) * (number of columns - 1) = (4 - 1) * (2 - 1) = 3

Once you have the chi-squared value, you can compare it to the critical value from the chi-squared distribution table (with degrees of freedom = 3) at α=0.05. If the chi-squared value exceeds the critical value, you can reject the null hypothesis and conclude that there is an association between method of payment and age group.

2. To test for a significant difference between the treatment means, you can use a one-way analysis of variance (ANOVA). The null hypothesis is that there is no difference between the treatment means, and the alternative hypothesis is that there is at least one difference.

ANOVA involves calculating the sum of squares and degrees of freedom for between-groups and within-groups variation. Then, you can calculate the F-statistic using the equations:

F = (between-groups variability / within-groups variability)

To perform the ANOVA, you need to calculate the following:

a. Grand Mean: The average of all the observations (27.9 in this case).

b. Sum of Squares Between (SSB): The sum of the squared differences of the treatment means from the grand mean, weighted by sample size.

SSB = Σ(ni * (mean_i - grand mean)^2)

c. Degrees of Freedom Between (DFB): The number of treatments minus 1.

DFB = Number of treatments - 1

d. Sum of Squares Within (SSW): The sum of the squared differences of the individual observations from their respective treatment means.

SSW = Σ[(xi - mean_i)^2]

e. Degrees of Freedom Within (DFW): The total number of observations minus the number of treatments.

DFW = Total Number of Observations - Number of Treatments

f. Mean Squares Between (MSB): SSB divided by DFB.

g. Mean Squares Within (MSW): SSW divided by DFW.

h. F-statistic: MSB divided by MSW.

Once you have the F-statistic, you can compare it to the critical value from the F-distribution table (with DFB and DFW degrees of freedom) at α=0.05. If the F-statistic exceeds the critical value, you can reject the null hypothesis and conclude that there is a significant difference between the treatment means.

I hope this helps you with your questions! If you have any further doubts or need more assistance, feel free to ask.