Help using Base SAS procedures

Proc Freq: How to preform a multiple comparison in Proc Freq?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Proc Freq: How to preform a multiple comparison in Proc Freq?

I need to analysis a imbalanced Incomplete blocks design. Because the distribution is not normal. I decided to use Non parametric method to analysis. I am thinking maybe the Durbin's Test.

data test;

input subject trt response;

datalines;

1  A 2

1  B 2.5

2  A .

2  C 5

3  A 2

3  D 8

4  B 4

4  A 8

5  B 3

5  C 2

6  B .

6  D 8

7  C 4

7  A 2

8  C 1

8  B 7

9  C 2

9  D 8

10  D 2

10  A 0

11  D 5

11  B 2

12  D 7

12  C .

;

PROC FREQ;

table subject* trt*response / noprint cmh2 scores=rank;

run;

I would output the overall Trt difference P-value, but how to do the multiple comparison to show the difference between each two trts?

Thanks,

FRED


Accepted Solutions
Solution
‎07-02-2014 02:55 PM
Respected Advisor
Posts: 2,655

Re: Proc Freq: How to preform a multiple comparison in Proc Freq?

PROC MULTTEST is your best bet here.  I would suggest doing as you already have to test for overall differences.  if that is significant, then comes the not-so-fun part with 4 treatments.  You will need 6 runs of proc freq, pairwise comparing each treatment to every other treatment, and saving the raw p values to a common dataset.  You may then apply PROC MULTTEST as in Example 65.5 inputting Raw p-Values.  There are a variety of adjustment methods available.  I am a fan of stepdown Sidak or false discovery rate control methods.

Steve Denham

View solution in original post


All Replies
Super User
Posts: 9,769

Re: Proc Freq: How to preform a multiple comparison in Proc Freq?

Not sure, Maybe you should check proc glm + lsmeans  /durb 

Occasional Contributor
Posts: 5

Re: Proc Freq: How to preform a multiple comparison in Proc Freq?

Thanks for your advise. I am thinking that maybe lsmean is using a different algorithm if there are some missing values and incomplete blocks. Maybe Glm +Mean?

Solution
‎07-02-2014 02:55 PM
Respected Advisor
Posts: 2,655

Re: Proc Freq: How to preform a multiple comparison in Proc Freq?

PROC MULTTEST is your best bet here.  I would suggest doing as you already have to test for overall differences.  if that is significant, then comes the not-so-fun part with 4 treatments.  You will need 6 runs of proc freq, pairwise comparing each treatment to every other treatment, and saving the raw p values to a common dataset.  You may then apply PROC MULTTEST as in Example 65.5 inputting Raw p-Values.  There are a variety of adjustment methods available.  I am a fan of stepdown Sidak or false discovery rate control methods.

Steve Denham

Occasional Contributor
Posts: 5

Re: Proc Freq: How to preform a multiple comparison in Proc Freq?

Thank you so much, Steve. and I have a following question,

still the same data set. can we ASSIGN RANKS for each blocks, and if we come across a missing value, we will manually assign a median rank to it (in this case (1+2)/2=1.5). then use PROC MIXED to do the analysis?

proc rank data= test out=base;

by subject;

var response;

ranks R_res;

run;

data base;set base;

if response=. then R_res=1.5;

run;

  proc mixed data=base;

  class trt subject  ;

  model R_res=trt subject /residual  htype=3;

  lsmeans trt/diff  cl alpha=0.05;

  run;

Respected Advisor
Posts: 2,655

Re: Proc Freq: How to preform a multiple comparison in Proc Freq?

If you rank by subject, all of the values will be 1, 2 or 1.5, so far as I can tell.  What about ranking across all subjects (drop the by subject line in PROC RANK) and insert back in the median rank (12.5) for the missings.  Then, using PROC MIXED, I would try:

proc mixed data=base;

class trt subject;

model R_res=trt;

random subject;

lsmeans trt/diff cl adjust=simulate(seed=1);

run;

This works for the test data stream.

Steve Denham

Occasional Contributor
Posts: 5

Re: Proc Freq: How to preform a multiple comparison in Proc Freq?

Thank you so much again, I will try on this one and let you know the results Smiley Happy!

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 289 views
  • 0 likes
  • 3 in conversation