BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
HuongPham
Calcite | Level 5

Hello,

Does anyone have experience in comparing medians for weighted data? For example I would like to compare the median age of the patients to see if they change over time/season, what is the best SAS procedures and statistical computation options can be used? I am looking into Proc SurveyMeans and Proc surveyreg and proc quantreg but would like to hear your thoughts/inputs. Thanks so much and Happy New Year!!

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Do you have survey data, or not? What do the weights represent?

 

If not, here is a long discussion with a very good answer in the case of unweighted medians: https://communities.sas.com/t5/Statistical-Procedures/Compare-two-medians/td-p/82303. For weighted medians, I believe you can use the FREQ statement in PROC NPAR1WAY to compare different medians, if I am understanding you properly.

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Do you have survey data, or not? What do the weights represent?

 

If not, here is a long discussion with a very good answer in the case of unweighted medians: https://communities.sas.com/t5/Statistical-Procedures/Compare-two-medians/td-p/82303. For weighted medians, I believe you can use the FREQ statement in PROC NPAR1WAY to compare different medians, if I am understanding you properly.

--
Paige Miller
HuongPham
Calcite | Level 5

Hi Paige Miller,

 

Appreciate your response on New Year's Eve day!! We do have survey data and sample weight (sampwght) is calculated base don different sampling strategy used by different sites. So with Proc Surveymeans allow to look at mean or median age for different groups but does not allow testing the difference I don't think. Thanks

Rick_SAS
SAS Super FREQ

I think you can use the CONTRAST statement in PROC SURVEYREG to estimate the difference of means between groups. See 34607 - How can I compare means in PROC SURVEYMEANS? (sas.com)

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
  • 3 replies
  • 1475 views
  • 0 likes
  • 3 in conversation