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

Is there a way to calculate p-values comparing medians for two independent populations using summary data? I am trying to see if median length of stay for two different groups are significantly different from each other and I do not have the raw data, all I have are the medians for the two groups and the sample size used to calculate the medians. If anyone out there knows how to approach this situation please help.

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @Jep,

 

Imagine the histograms of the two empirical distributions (combined in one plot). Then modify the distributions by increasing the variances to very large values (i.e. broad, largely overlapping, almost identical histograms) or shrinking them to zero (i.e. isolated peaks at the two median values) -- leaving the medians and sample sizes fixed. Obviously, doing so must have an impact on the results (e.g. the p-value) of any reasonable statistical test comparing the medians. So, the test you envisioned cannot exist.

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

If all you have is the median, and the N for each sample, then I don't think you can calculate a confidence interval or p-value.

--
Paige Miller
Reeza
Super User
Tests for median are usually non parametric and require the full data set or more information to be useful.
FreelanceReinh
Jade | Level 19

Hi @Jep,

 

Imagine the histograms of the two empirical distributions (combined in one plot). Then modify the distributions by increasing the variances to very large values (i.e. broad, largely overlapping, almost identical histograms) or shrinking them to zero (i.e. isolated peaks at the two median values) -- leaving the medians and sample sizes fixed. Obviously, doing so must have an impact on the results (e.g. the p-value) of any reasonable statistical test comparing the medians. So, the test you envisioned cannot exist.

ballardw
Super User

For any given sample size N and a median value M there are an infinite number of samples that will meet that condition. Consider N= 3 and M= 5:

1 5 10

1 5 11

2 5 10

3 5 10

3 5 11

1 5 9999999999999999999999999

<continue until completely mind numbed>

each of these samples is of size N=3 and median of 5.

So without complete data or at least some information about dispersion of values I think you are going to be stuck..

 

Rick_SAS
SAS Super FREQ

I'll add one more observation. You might not need all observations, but you need some relevant quantiles (percentiles).

 

If N=100, a 95% CI for the median is often estimated by using the 40th and 60th percentiles.

 

In general, if you know N, you can estimate a CI by using the percentiles

N/2  +/- 1.96*sqrt(N)/2

 

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
  • 5 replies
  • 8873 views
  • 8 likes
  • 6 in conversation