In: Statistics and Probability
Compare the chi-squared test for goodness of fit to the chi-squared test for independence. Be sure to mention number of samples and the number of levels of categories for your comparison. Also provide the alternative hypothesis for both.
Solution:-
Chi squared test for goodness of fit.
The chi-square goodness of fit test is applied when you have one categorical variable from a single population. It is used to determine whether sample data are consistent with a hypothesized distribution.
Total number of categorical variable = k
D.F = k - 1
Null hypothesis: All the observed outcomes follows the given distribution.
Alternative hypothesis: At least one of the proportions in the null hypothesis is false.
Chi squared test for independence.
The chi-square test for independence is applied when you have two categorical variables from a single population. It is used to determine whether there is a significant association between the two variables.
D.F = (r - 1) * (c - 1)
r = number of levels for one categorical variable
c = number of levels for second categorical variable
H0: Two variables are independent.
Ha: Two variables are not independent.