Obsidian | Level 7

## How to calculate p-values for medians using summary data

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

## Re: How to calculate p-values for medians using summary data

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.

5 REPLIES 5
Diamond | Level 26

## Re: How to calculate p-values for medians using summary data

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
Super User

## Re: How to calculate p-values for medians using summary data

Tests for median are usually non parametric and require the full data set or more information to be useful.

## Re: How to calculate p-values for medians using summary data

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.

Super User

## Re: How to calculate p-values for medians using summary data

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

SAS Super FREQ

## Re: How to calculate p-values for medians using summary data

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

Discussion stats
• 5 replies
• 7077 views
• 8 likes
• 6 in conversation