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

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
Pyrite | Level 9

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
Pyrite | Level 9

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
Pyrite | Level 9

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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 7159 views
  • 5 likes
  • 4 in conversation