Goodness-of-fit tests assess how well sample data matches the population's expectations. An observed value is derived from the sample data and compared to the predicted expected value using a discrepancy measure.
Simply said, the greater the divergence between these numbers, the higher the chi square score, the more likely it is to be significant, and the more likely we will reject the null hypothesis and conclude the variables are related.
The chi-square test can be used for testing the strength of the association between two categorical variables (i.e., in terms of proportions) or two continuous variables (i.e., in terms of means and standard deviations).
A chi-square test is used to compare observed and expected frequencies for categorical variables. In this case, the categorical variable is whether or not a person has a given characteristic.
Chi-square is a statistical test that examines the differences between categorical variables from a random sample in order to determine if the expected and actual findings are well-fitting.