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