Respuesta :
Answer:
[tex]\chi^2 =27.356[/tex]
[tex]p_v = P(\chi^2_{9} >27.356)=0.00122[/tex]
And we can find the p value using the following excel code:
"=1-CHISQ.DIST(27.356,9,TRUE)"
Since the p value is lower than the significance level assumed 0.05 we can reject the null hypothesis at 5% of significance, and we can conclude that we have association between the two variables analyzed.
Step-by-step explanation:
A chi-square goodness of fit test "determines if a sample data matches a population".
A chi-square test for independence "compares two variables in a contingency table to see if they are related. In a more general sense, it tests to see whether distributions of categorical variables differ from each another".
Assume the following dataset:
              Amusement Parks   Mexico   Home   Other   Total
Freshman           23             21       43      21     108
Sophomore          34             23       14      26     97
Junior              25             30       23     26     104
Senior              27             33       17     19     96
Total               109             107       97     92     405
We need to conduct a chi square test in order to check the following hypothesis:
H0: There is independence between the two random variables
H1: There is dependence between the two variables
The level os significance assumed for this case is [tex]\alpha=0.05[/tex]
The statistic to check the hypothesis is given by:
[tex]\chi^2 =\sum_{i=1}^n \frac{(O_i -E_i)^2}{E_i}[/tex]
The table given represent the observed values, we just need to calculate the expected values with the following formula [tex]E_i = \frac{total col * total row}{grand total}[/tex]
And the calculations are given by:
[tex]E_{1} =\frac{109*108}{405}=29.07[/tex]
[tex]E_{2} =\frac{107*108}{405}=28.53[/tex]
[tex]E_{3} =\frac{97*108}{405}=25.87[/tex]
[tex]E_{4} =\frac{92*108}{405}=24.53[/tex]
[tex]E_{5} =\frac{109*97}{405}=26.11[/tex]
[tex]E_{6} =\frac{107*97}{405}=25.63[/tex]
[tex]E_{7} =\frac{97*97}{405}=23.23[/tex]
[tex]E_{8} =\frac{92*97}{405}=22.03[/tex]
[tex]E_{9} =\frac{109*104}{405}=27.99[/tex]
[tex]E_{10} =\frac{107*104}{405}=27.48[/tex]
[tex]E_{11} =\frac{97*104}{405}=24.91[/tex]
[tex]E_{12} =\frac{92*104}{405}=23.62[/tex]
[tex]E_{13} =\frac{109*96}{405}=25.84[/tex]
[tex]E_{14} =\frac{107*96}{405}=25.36[/tex]
[tex]E_{15} =\frac{97*96}{405}=22.99[/tex]
[tex]E_{16} =\frac{92*96}{405}=21.81[/tex]
And the expected values are given by:
            Amusement Parks   Mexico   Home   Other   Total
Freshman          29.07         28.53   25.87   24.53    108
Sophomore         26.11          25.63   23.23   22.03    97
Junior             27.99         27.48   24.91    23.62   104
Senior             25.84         25.36   22.99    21.81    96
Total               109            107     97      92     405
And now we can calculate the statistic:
[tex]\chi^2 =27.356[/tex]
Now we can calculate the degrees of freedom for the statistic given by:
[tex]df=(rows-1)(cols-1)=(4-1)(4-1)=9[/tex]
And we can calculate the p value given by:
[tex]p_v = P(\chi^2_{9} >27.356)=0.00122[/tex]
And we can find the p value using the following excel code:
"=1-CHISQ.DIST(27.356,9,TRUE)"
Since the p value is lower than the significance level assumed 0.05 we can reject the null hypothesis at 5% of significance, and we can conclude that we have association between the two variables analyzed.