> Hi,
>
> I want to test whether there is a significant
> difference in proportions between two groups at each
> level of a 20-level variable. I've been trying to
> use proc surveyfreq with the code below, but it isn't
> providing the results for the chisquare test (only
> frequencies and standard errors for each level of the
> variable).
>
> proc surveyfreq data=new;
> tables group*variable / chisq;
> run;
>
> Does anyone have any suggestions for how to do this
> and ensure that the hypotheses I'm testing are for
> differences at each level of the 20-level variable
> between the two groups (ie, so I get a separate
> p-value for each of the 20 levels)?
> Thanks!!
> Nicole
My first question is why you are using SURVEYFREQ when you have no cluster or strata statements, you could just use FREQ.
My second question is whether you could show us some of the log? Any errors or warnings? You ought to get some sort of chisq test with this code
Third, AFAIK you don't get a separate p-value for each of the 20 levels. I know you don't get this with FREQ. If you want something like this, you need a different PROC. Perhaps LOGISTIC or SURVEYLOGISTIC or something.
Finally, what's your sample size? 20 levels is a lot.
HTH
Peter