BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jonatan_velarde
Lapis Lazuli | Level 10

Good Day SAS friends:

I'm trying to carry an analysis about non parametric ANOVA (Kruskal-Wallis) using PROC NPAR1WAY to analise 4 groups and i cant find information how to compare means/medians, if you can help me to find any way to use some TUKEY (or similar) to do this, i would appreciate very much.

Thanks a lot

1 ACCEPTED SOLUTION
8 REPLIES 8
jonatan_velarde
Lapis Lazuli | Level 10

Hi there and thanks a lot for the answer.

I saw this treat in SAS questions, latter i found this article:

http://www.lexjansen.com/pharmasug/2004/statisticspharmacokinetics/sp04.pdf

here, the author accomplish the comparison using an MACRO called "%DUNN"

Now im worry about running that macro, cause i never worked with any macros....

Could you send me some information about runnig macros ??

Thanks

data_null__
Jade | Level 19

Macros are easy to run "if they work".  It is just a matter of submitting the macro code followed by a "macro call".

%macro DUNN(....);

     <sas code>

     %mend DUNN;

%DUNN(.......);

Also the SAS online documentation has everything you want to know about how to run macros.

jonatan_velarde
Lapis Lazuli | Level 10

Thanks one more time for your help.

i found the macro here:

http://www.alanelliott.com/kw/KW_MC.sas

i tried too but no succes.

Thanks

data_null__
Jade | Level 19

You will have to show your work.

jonatan_velarde
Lapis Lazuli | Level 10

sorry for delayed answer my SAS friends:

Finally i made it, run the DUNN macro and fixed the problem.

Thanks a lot.

If its necesary you can ask for the complete routine here.

Big Hugs

rmed057
Calcite | Level 5

Hello,

 

I am attempting to run the Dunn Macro package of code right now. I am about half way through but have gotten snagged on a data step. It seems like there are more coming up as well. 

 

data KW_MC_TMP5;set KW_MC_TMP5;
1294 N=_N_;
1295 keep n mean1-mean&groups;
WARNING: Apparent symbolic reference GROUPS not resolved.
ERROR: Missing numeric suffix on a numbered variable list (mean1-mean).
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, _ALL_, _CHARACTER_,
_CHAR_, _NUMERIC_.

ERROR 200-322: The symbol is not recognized and will be ignored.

 

Is there a way to resolve this? I am relatively new to SAS and trying to learn while using (not highly recommended) but any advice with this will be greatly appreciated. 

The upcoming steps have similar synthax. 

 

data KW_MC_TMP6;set KW_MC_TMP6;
N=_N_;
keep n n1-n&groups;
run;

 

data KW_MC_TMP7;set KW_MC_TMP7;
N=_N_;
keep n gp1-gp&groups;
run;

 

Thanks! 

Ksharp
Super User

Or you could check Row Mean Scores in proc freq .

ANOVA (Row Mean Scores) Statistic

The ANOVA statistic can be used only when the column variableY lies on an ordinal (or interval)

scale so that the mean score ofY is meaningful. For the ANOVA statistic, the mean score is computed

for each row of the table, and the alternative hypothesis is that, for at least one stratum, the mean

scores of the R rows are unequal. In other words, the statistic is sensitive to location differences

among the R distributions ofY.

When there is only one stratum, this CMH statistic is essentially an analysis of variance (ANOVA)

statistic in the sense that it is a function of the variance ratio F statistic that would be obtained from

a one-way ANOVA on the dependent variableY. If nonparametric scores are specified in this case,

then the ANOVA statistic is a Kruskal-Wallis test.

If there is more than one stratum, then this CMH statistic corresponds to a stratum-adjusted ANOVA

or Kruskal-Wallis test. In the special case where there is one subject per row and one subject

per column in the contingency table of each stratum, this CMH statistic is identical to Friedman’s

chi-square.

Xia Keshan

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 8 replies
  • 7881 views
  • 5 likes
  • 4 in conversation