Posts: 3,805

# Pair-wise Comparisons in Nonparametric One-Way ANOVA.

Where there are more than 2 levels of treatments and you want pairwise comparisons is it correct to run NPAR1WAY for each pair of treatments.  I want to produce p-value combinations similar to LSMEANS TRT / DIFF;

Example program of my proposed pairwise calls to NPAR1WAYs.  Is this a valid statistical analysis?  Keep in mind I only have an 8th grade education. :smileyshocked:

`proc plan seed=997015200;   factors id=10 ordered trt=4 y=1 of 50 / noprint;   output out=sample trt cvals=('A' 'B' 'C' 'D');   run;   quit;proc sort;   by id trt;   run;proc print;   run;proc npar1way data=sample;   class trt;   var y;   run;proc sql feedback;   create view pairedV1 as   select a.id,a.trt as trt1,a.y as y1,b.trt,b.y      from sample as a, sample as b      where a.id eq b.id             and a.trt gt b.trt      order by b.trt,a.trt,a.id      ;   quit; data paired(keep=pairID trt y id);   set pairedV1;   length pairID \$3;   pairID = catx('-',trt,trt1);   output;   y     =  y1;   trt   =  trt1;   output;   run;proc print;   run;*ods listing close;*ods trace on;proc npar1way data=paired wilcoxon;   by pairID;   class trt;   var y;   ods output WilcoxonScores=WilcoxonScores WilcoxonTest=WilcoxonTest;   run;*ods trace off;ods listing;proc print data=WilcoxonTest;   run;`

Message was edited by: data _null_

Super User
Posts: 20,731

## Pair-wise Comparisons in Nonparametric One-Way ANOVA.

Typically when you run multiple pairwise comparisons you don't need to adjust your calculations but you do need to adjust your cutoff point. Bonferonni corrections are common, but there are more out there that might make sense depending on exactly what you're testing.

http://en.wikipedia.org/wiki/Multiple_comparisons

Super User
Posts: 10,210

## Pair-wise Comparisons in Nonparametric One-Way ANOVA.

Where there are more than 2 levels of treatments and you want pairwise comparisions is it.

You can't use proc npar1way for this situation. npar1way only is used for two levels. If you use it for more than two levels ,then the Alpha(the probability of the first type of error) will be unrespected, because you compare them many times.

You should use proc glm.

Ksharp

Posts: 3,805

## Re: Pair-wise Comparisons in Nonparametric One-Way ANOVA.

`proc plan seed=997015200;   factors id=10 ordered trt=3 y=1 of 50 / noprint;   output out=sample trt cvals=('A' 'B' 'C');   run;   quit;proc rank data=sample out=sample;   var y;   ranks yr;   run;proc print;   run;title 'Scored from proc';proc npar1way data=sample ks;   class trt;   var y;   run;title 'Scores=data';proc sql feedback;   create view pairedV1 as   select a.id,a.trt as trt1,a.yR as y1,b.trt,b.yR       from sample as a, sample as b      where a.id eq b.id             and a.trt gt b.trt      order by b.trt,a.trt,a.id      ;   quit; data paired(keep=pairID trt yR id);   length pairID \$3;   pairID = 'ABC';   do until(eof1);      set sample end=eof1;      output;      end;   do until(eof2);      set pairedV1 end=eof2;      pairID = catx('-',trt,trt1);      output;      yR     =  y1;      trt   =  trt1;      output;      end;   stop;   run;proc print;   run;proc npar1way data=paired scores=data;   by pairID notsorted;   class trt;   var yR;   *ods output       DataScores=DataScores      DataScoresAnalysis=DataScoresAnalysis      DataScoresTest=DataScoresTest      ;    run;`
Super User
Posts: 10,210

## Re: Pair-wise Comparisons in Nonparametric One-Way ANOVA.

I think it is no. You should use proc glm. It is not business about using parameter method or non-parameter method.

Posts: 3,805

Bump.

PROC Star
Posts: 7,651