New SAS User

Completely new to SAS or trying something new with SAS? Post here for help getting started.
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AndreaSch
Calcite | Level 5

Dear Sir or Madame, 

 

I want to perform a post-hoch test for the Kruskal-Wallis test. I have already written my code for this test and it showed differences between the groups. So now, I red, that you can do a Bonferroni-post-hoc test. However, I cannot find a procedure for that. Does anybody know how to do it? Or can anybody show my another post-hoc test for my problem? 

 

This is the used code for the Kruskal-Wallis test. Mabey it’s possible to extend it?

PROC NPAR1WAY DATA = Statistik WILCOXON;
CLASS Gruppe; 
EXACT; 
RUN;

 I am running SAS version 9.4. on Windows. 

 

I appreciate any help. Thanks in advance.

Regards

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@AndreaSch wrote:

Thanks both to you for your answers. I tried your advice. But I still have an error and I don't know how to solve the problem. My code is below. Besides I wrote something about raw p-Values. Can' I just use my measuring results? Do I have to compute new ones? 

 

 


I don't think p-values are allowed to be greater than 1 since they are probabilities.

 

This runs though I make no claim for appropriate values for the p-values.

DATA work.Statistik;
INPUT Gruppe Raw_P @@;
Raw_P = Raw_P/10000; 
CARDS;
1	1320.527281	1	1294.800111	1	1242.468356
1.5	1211.42937	1.5	1418.558864	1.5	1129.583849
2	725.241616	2	1436.191316	2	1216.12421
2.5	1251.782715	2.5	710.0275351	2.5	1251.788858
3	1230.328215	3	1384.634321	3	1300.866933
3.5	1396.716718	3.5	1457.118658	3.5	1426.917688
4	1300.747017	4	730.510824	4	1236.251115
5	1404.1575	5	1354.503454	5	1330.99349
10	1476.694468	10	1416.509109	10	1380.101564
15	1401.714976	15	1364.866794	15	1408.147304
20	1148.021385	20	1239.254325	20	1239.254325
25	1217.440692	25	1193.010811	25	1112.880134
RUN;
PROC MULTTEST INPVALUES=work.Statistik bon;
RUN; 

 

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

PROC GLM can do Bonferroni t-tests, using the MEANS statement and the BON option.

 

PROC MULTTEST will perform the post-hoc adjustments for Bonferroni (and other) tests.

 

I'm not aware of a non-parametric way to do this.

--
Paige Miller
PGStats
Opal | Level 21

Proc multtest is exactly for that purpose. Check the INPVALUES= option.

PG
AndreaSch
Calcite | Level 5

Thanks both to you for your answers. I tried your advice. But I still have an error and I don't know how to solve the problem. My code is below. Besides I wrote something about raw p-Values. Can' I just use my measuring results? Do I have to compute new ones? 

 

DATA Statistik;
INPUT Gruppe Raw_P @@; 
CARDS;
1	1320.527281	1	1294.800111	1	1242.468356
1.5	1211.42937	1.5	1418.558864	1.5	1129.583849
2	725.241616	2	1436.191316	2	1216.12421
2.5	1251.782715	2.5	710.0275351	2.5	1251.788858
3	1230.328215	3	1384.634321	3	1300.866933
3.5	1396.716718	3.5	1457.118658	3.5	1426.917688
4	1300.747017	4	730.510824	4	1236.251115
5	1404.1575	5	1354.503454	5	1330.99349
10	1476.694468	10	1416.509109	10	1380.101564
15	1401.714976	15	1364.866794	15	1408.147304
20	1148.021385	20	1239.254325	20	1239.254325
25	1217.440692	25	1193.010811	25	1112.880134
RUN;
PROC MULTTEST INPVALUES=Statistik bon;
RUN; 

Thanks in advance. 

ballardw
Super User

@AndreaSch wrote:

Thanks both to you for your answers. I tried your advice. But I still have an error and I don't know how to solve the problem. My code is below. Besides I wrote something about raw p-Values. Can' I just use my measuring results? Do I have to compute new ones? 

 

 


I don't think p-values are allowed to be greater than 1 since they are probabilities.

 

This runs though I make no claim for appropriate values for the p-values.

DATA work.Statistik;
INPUT Gruppe Raw_P @@;
Raw_P = Raw_P/10000; 
CARDS;
1	1320.527281	1	1294.800111	1	1242.468356
1.5	1211.42937	1.5	1418.558864	1.5	1129.583849
2	725.241616	2	1436.191316	2	1216.12421
2.5	1251.782715	2.5	710.0275351	2.5	1251.788858
3	1230.328215	3	1384.634321	3	1300.866933
3.5	1396.716718	3.5	1457.118658	3.5	1426.917688
4	1300.747017	4	730.510824	4	1236.251115
5	1404.1575	5	1354.503454	5	1330.99349
10	1476.694468	10	1416.509109	10	1380.101564
15	1401.714976	15	1364.866794	15	1408.147304
20	1148.021385	20	1239.254325	20	1239.254325
25	1217.440692	25	1193.010811	25	1112.880134
RUN;
PROC MULTTEST INPVALUES=work.Statistik bon;
RUN; 

 

AndreaSch
Calcite | Level 5

Thank you very much. Now my code is running. However, how can I interpret the result according to the post hoc Kurskal-Wallis test I want to perform? Now I get raw p-values and Bonferroni p-values. Every Bonferroni value is 1.0000. 

 

 

 

 

image.png

 

Thanks in advance

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 6805 views
  • 3 likes
  • 4 in conversation