BookmarkSubscribeRSS Feed
Fluorite | Level 6



Is it possible with SAS to compute 95% confidence intervals for a Wilcoxon Signed Rank test, sample size 50?


Currently I am using the following code, which do not provide CI :

ods select TestsForLocation;

proc univariate data = MFP.NutrientsT2_Diff ;

title "Nonparametric Test NoQC - Wilcoxon Signed Rank Test";

var Sod_Diff Sod_DiffQC;



Thank you!


PROC UNIVARIATE provides a one-sample test for location. Based on your sample code, it looks like you might be interested in a two-sample test for the difference between two groups,  If so, use PROC NPAR1WAY and the WILCOXON option. An example is provided in the PROC NPAR1WAY documentation. Notice that you'll have to transform your data set from "wide" format to "long" format by including a binary CLASS variable that indicates the groups.


That said, I don't understand your statement. You don't get confidence intervals for test. A statistical test generates a statistic which you use to accept or reject some hypothesis at some significance level. You can get CIs for the parameter that the statistic estimates, but not for a test.

Fluorite | Level 6

I have used Wilcoxon Signed Rank, as my data are both dependent and not normally distributed.


With NPAR1WAY, I thought, you have rank sum test and assume independent data.


I indeed refer to the t-statistic of the Wilcoxon Signed Rank.


Thank you!


The bootstrap method enables you to examine the sampling distribution of any statistic.

For a univariate statistic, start by reading 

"Compute a bootstrap confidence interval in SAS"

If you decide to go with the two-sample version, imitate the ideas and programs in

"The bootstrap method in SAS: A t test example"


Barite | Level 11

You can use Hodges - Lehmann (HL) estimation to show the CIs:

proc NPAR1WAY data=tegs /*wilcoxon*/;
title "Nonparametric test to compare respiration between growth and gap area";
class orchard;
var apples;
exact wilcoxon HL;


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!

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
  • 4 replies
  • 1 like
  • 3 in conversation