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-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!

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