Answer:
And we can find the p value using the following excel code:
"=1-CHISQ.DIST(8.180,3,TRUE)"
Since the p value is lower than the significance level we can to reject the null hypothesis at 5% of significance, and we can conclude that we have significant differences in the proportions assumed.
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".
The observed values are given by:
Democratic 540
Republican 480
Independent 40
Undecided 140
We need to conduct a chi square test in order to check the following hypothesis:
H0: There is no difference in the proportions for the political party
H1: There is a difference in the proportions for the political party
The level os significance assumed for this case is
The statistic to check the hypothesis is given by:
Now we just need to calculate the expected values with the following formula
And the calculations are given by:


And now we can calculate the statistic:
Now we can calculate the degrees of freedom for the statistic given by:

And we can calculate the p value given by:
And we can find the p value using the following excel code:
"=1-CHISQ.DIST(8.180,3,TRUE)"
Since the p value is lower than the significance level we can to reject the null hypothesis at 5% of significance, and we can conclude that we have significant differences in the proportions assumed.