------------------------------------------------------------------------------------------------------------ help for csgof ------------------------------------------------------------------------------------------------------------ Chi-Square Goodness of Fit -------------------------- Syntax ------ csgof variable [, expperc( expected percentages ) ] The csgof command performs a chi-square goodness of fit test. This allows you to test whether the observed percentages for a categorical variable are significantly different from expected percentages. The expected percentages are supplied via expperc( ) and are listed simply as a series of numbers. The order of the values in expperc( ) should correspond to the sorted order of the variable. Note that the data is expected to have one observation per subject. You may need to use the expand command to make the data file have one observation per subject. Examples -------- . use https://stats.idre.ucla.edu/stat/stata/notes/hsb2 . csgof race, expperc(10 10 10 70) . csgof race /* assuming equal expectations per category */ Acknowledgements ---------------- Thanks to Dr. Dirk Enzmann, Institute of Criminal Sciences, Dept. of Criminology, Universitat Hamburg for his code for equal expectations ber category. Author ------ Michael N. Mitchell Statistical Computing Group UCLA Academic Technology Services mnm@ucla.edu