Fluorite | Level 6

## How to compute confidence intervals for Wilcoxon Signed Rank?

Hello,

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;

run;

Thank you!

4 REPLIES 4
SAS Super FREQ

## Re: How to compute confidence intervals for Wilcoxon Signed Rank?

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

## Re: How to compute confidence intervals for Wilcoxon Signed Rank?

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!

SAS Super FREQ

## Re: How to compute confidence intervals for Wilcoxon Signed Rank?

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

## Re: How to compute confidence intervals for Wilcoxon Signed Rank?

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;
run;

Discussion stats
• 4 replies
• 4521 views
• 1 like
• 3 in conversation