Dear listers,
I'd like to test whether the distribution of observations in my sample across 30 different regions is representative of that of the population. So for both sample and population I have 30 percentage values (most non-integer, some 0). Now I'm unsure which test or command I should use.
My best guess was to use a Chi2 test, but I've had trouble implementing that in Stata:
When I use -chi2fit freq_population freq_sample- , I get the error "Are you sure you want to run this program with so few observations?". 30 different categories doesn't strike me as few, or does chi2fit need to see all observations rather than just 1 percentage per category?
When I try -csgof freq_sample, expperc(12.38 5.32 ... 0.26)-, I get an error message claiming that freq_sample has fewer observations than the 30 specified in expperc, although I've recounted and this is not true. I also get the error message when replacing all zeros with 0.000001 to check whether the problem might be Stata not counting 0 frequencies, but that wouldn't solve the problem.
Can anyone help here?
Thank you so much and kind regards,
JZ
I'd like to test whether the distribution of observations in my sample across 30 different regions is representative of that of the population. So for both sample and population I have 30 percentage values (most non-integer, some 0). Now I'm unsure which test or command I should use.
My best guess was to use a Chi2 test, but I've had trouble implementing that in Stata:
When I use -chi2fit freq_population freq_sample- , I get the error "Are you sure you want to run this program with so few observations?". 30 different categories doesn't strike me as few, or does chi2fit need to see all observations rather than just 1 percentage per category?
When I try -csgof freq_sample, expperc(12.38 5.32 ... 0.26)-, I get an error message claiming that freq_sample has fewer observations than the 30 specified in expperc, although I've recounted and this is not true. I also get the error message when replacing all zeros with 0.000001 to check whether the problem might be Stata not counting 0 frequencies, but that wouldn't solve the problem.
Can anyone help here?
Thank you so much and kind regards,
JZ
Comment