BookmarkSubscribeRSS Feed
jessho
Calcite | Level 5

Hi-

I have two non-normally distributed variables, RA_Opening and RA_Vasoactive, which are not independent.  I am trying to run a non-parametric test on them--wilcoxin signed rank test.

 

What is the easiest way to do this?  Should I just create a new variable, RA_Change, for difference between the two and run proc univariate or is there another way?

 

Data per below:

RA_OpeningRA_Vasoactive
218
1514
1518
86
289
1812
3015
104
64
155
2711
15 
138
144
102
88
1114
1816
198
129
168
1212
1314
2 REPLIES 2
ballardw
Super User

By not independent do you mean that your RA_Vasoactive values are expected to change in a certain manner with changes in the RA_Opening value (or vice versa)?

 

That would look more like a regression problem.

 

Otherwise the Univariate approach seem like what you want with an added variable for the difference if the values are paired

Rick_SAS
SAS Super FREQ

I assume that these are paired observations before and after some time period or event. You can compute the difference between the values and test whether the mean (or median) difference is significantly different from 0:

 

data Have;
input RA_Opening	RA_Vasoactive;
diff = RA_Opening - RA_Vasoactive;
datalines;
21	8
15	14
15	18
8	6
28	9
18	12
30	15
10	4
6	4
15	5
27	11
15	 .
13	8
14	4
10	2
8	8
11	14
18	16
19	8
12	9
16	8
12	12
13	14
;
proc univariate data=Have mu0=0 loccount;
   var diff;
   histogram diff / href=0;
   ods select TestsForLocation LocationCounts Histogram;
run;

In this case, 17/20 differences are greater than 0, so the signed rank test rejects the null hypothesis that the difference is 0.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 265 views
  • 1 like
  • 3 in conversation