Programming the statistical procedures from SAS

PROC NPAR1WAY mean/median comparison

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 103
Accepted Solution

PROC NPAR1WAY mean/median comparison

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


Accepted Solutions
Solution
‎01-31-2015 11:48 AM
Respected Advisor
Posts: 3,773

Re: PROC NPAR1WAY mean/median comparison


All Replies
Solution
‎01-31-2015 11:48 AM
Respected Advisor
Posts: 3,773

Re: PROC NPAR1WAY mean/median comparison

Frequent Contributor
Posts: 103

Re: PROC NPAR1WAY mean/median comparison

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

Respected Advisor
Posts: 3,773

Re: PROC NPAR1WAY mean/median comparison

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.

Frequent Contributor
Posts: 103

Re: PROC NPAR1WAY mean/median comparison

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

Respected Advisor
Posts: 3,773

Re: PROC NPAR1WAY mean/median comparison

You will have to show your work.

Frequent Contributor
Posts: 103

Re: PROC NPAR1WAY mean/median comparison

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

New Contributor
Posts: 2

Re: PROC NPAR1WAY mean/median comparison

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! 

Grand Advisor
Posts: 9,447

Re: PROC NPAR1WAY mean/median comparison

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

☑ This topic is SOLVED.

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

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