Book Image

Data Analysis with STATA

Book Image

Data Analysis with STATA

Overview of this book

Table of Contents (16 chapters)
Data Analysis with Stata
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The chi-square goodness of fit test


The chi-square (the goodness of fit check) gives you the option to test whether proportions of observed values statistically differ from the values in the hypothesis population proportions.

The chi-square statistical test is generally leveraged to compare the observed data with the hypothesized data. It also gives you an idea about the goodness of fit before you start with the modeling exercise. It checks for the deviations between different samples of the observed data, what we believe the data would look like, and what insights the data will have. The chi-square test gives you the deviation with respect to a null hypothesis.

For example, let's assume that the inventory of fridges consists of 20% model1, 20% model2, 10% model3, and 50% model4. We need to check whether the observed data has proportions in the sample data. For such problems, you need to run a chi-square test of the goodness of fit. Here is how you perform the chi-square test for the goodness...