Answer
In both Chi-square goodness of fir test and chi-square independent variable test, the data are obtained from a random sample. Other than that, the expected frequency for each category must be 5 or more. In goodness-of-fit test, it is used to determine whether the proportions for a variable are equal when several samples are selected from different populations. The test of independence of variables is used to determined whether two variables are independent of or related to each other when a single sample is selected. The other differences are, in the test of independence of variables, the observed values are obtained from the sample data. The expected values are computed from the observed values, and they are based on the assumption that the two variables are independent. In Chi-square goodness-of-fit test, if there is little difference between the observed values and the expected values, then the value of the test statistic will be small and the null hypothesis will not be rejected. Hence, the variables are independent of each other. However, if there are large differences in the observed values and the expected values, then there is enough evidence to say that the variables are dependent on or related to each other.