BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
fengyuwuzu
Pyrite | Level 9

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?

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

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;
lsmeans site/pdiff stderr cl adjust=sidak;
run;

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

 

Steve Denham

View solution in original post

4 REPLIES 4
Astounding
Opal | Level 21

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.

SteveDenham
Jade | Level 19

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;
lsmeans site/pdiff stderr cl adjust=sidak;
run;

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

 

Steve Denham

fengyuwuzu
Pyrite | Level 9

@SteveDenham  Yes! This works excellently!

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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