BookmarkSubscribeRSS Feed
zsarwar
Calcite | Level 5

what test can be used to compare medians in survey data, I am using NIS data.

my code

proc npar1way data=pan1 ;
class cac;
strata nis_stratum;
cluster hosp_nis;
weight discwt;
var LOS age;run;

2 REPLIES 2
ballardw
Super User

If the data is from a complex weighted survey and I want to apply the weights correctly I would be looking at Proc Surveymeans which would look something like this from your example code if CAC is supposed to be used to get the median of each of VAR variables for each level of CAC.

 

proc surveymeans data=pan1 median ;
   domain cac;
   strata nis_stratum;
   cluster hosp_nis;
   weight discwt;
   var LOS age;
run;

Ideally you should have some description of the type of sample on the Proc Surveymeans statement. That might include a RATE= option pointing to fixed sample rate number per stratum or a data set, which has a specific data structure, that contains the different sample rate for each stratum. Or a TOTAL= data set with the population total per stratum. (NOT both Rate and Total). These numbers should be available from the NIS website IIRC but what they are called I have no clue. It should be in sample description for each collection period.

 

IF you have combined collection periods then you may have opened a can of worms about the weights to use.

 

zsarwar
Calcite | Level 5
Thank you so much, I did use that to get the values (medians) for each group.
I am looking for statistical test like Wilcoxon rank sum test to see the difference across the variable "cac"

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 464 views
  • 0 likes
  • 2 in conversation