## Proc freq for 7x2 table, significant; how to pairwise

Solved
Super Contributor
Posts: 328

# Proc freq for 7x2 table, significant; how to pairwise

I have age, gender (M,F) and sites (1,2,...7) columns, and I used proc freq to test (sites, gender ) and it showed p<0.001.

``````proc freq data= demo_sites ;
tables gender*sites_signup /chisq;
run;``````

But, how to do a pairwised chi-square test? I want to see which two groups are signigicant, and which two are not.

can I use proc multtest in this case?

A similar question for testing means of age in the 7 sites groups. I can use proc anova or proc glm to do a ANOVA test.

Is the solution to use proc multtest and contrast statement, like http://www.ats.ucla.edu/stat/sas/library/multtest.htm?

Accepted Solutions
Solution
‎04-26-2016 03:34 PM
Posts: 2,655

## Re: Proc freq for 7x2 table, significant; how to pairwise

Regarding the testing of means, the LSMEANS statement in PROC GLM provides all of the options you need to compare all means in as many ways as you can think of, and adjust for the multiple comparisons using several methods.

``````proc glm data=yourdata;
class site;
model age=site;
run;``````

This gives a Sidak adjustment for the 21 comparisons possible between the mean ages at the 7 sites.

Steve Denham

All Replies
Super User
Posts: 6,751

## Re: Proc freq for 7x2 table, significant; how to pairwise

This isn't an exact answer, but it may be helpful.  Similar to CHISQ, there is an option (CELLCHISQ?  may need to check my spelling) that adds to each cell its contribution to the overall chi-square.

Super Contributor
Posts: 328

## Re: Proc freq for 7x2 table, significant; how to pairwise

Thank you!! it is CELLCHI2.

With your hints I found one example:

http://support.sas.com/documentation/cdl/en/procstat/63104/HTML/default/viewer.htm#procstat_freq_sec...

Thank you again!

Solution
‎04-26-2016 03:34 PM
Posts: 2,655

## Re: Proc freq for 7x2 table, significant; how to pairwise

Regarding the testing of means, the LSMEANS statement in PROC GLM provides all of the options you need to compare all means in as many ways as you can think of, and adjust for the multiple comparisons using several methods.

``````proc glm data=yourdata;
class site;
model age=site;
run;``````

This gives a Sidak adjustment for the 21 comparisons possible between the mean ages at the 7 sites.

Steve Denham

Super Contributor
Posts: 328

## Re: Proc freq for 7x2 table, significant; how to pairwise

@SteveDenham  Yes! This works excellently!

🔒 This topic is solved and locked.

Discussion stats
• 4 replies
• 489 views
• 1 like
• 3 in conversation