# determine if sample size is sufficient by comparing 25% and median values

Currently I have data (true population size is unknown). There are n data points in descending order, and we know the values of 25% and 50% percentile, say x1 and x2. How can I estimate if the sample size is sufficient such that x1, x2 are within 5% of margin of errors of x1 and x2?

For example, suppose n=1000 and data={4500, 621, 500,....0.001}, and the 250-th, 500-th observations are x1=200 and x2=50. How can I know if n=1000 is big enough such that even if increasing n, x1=200 +/- 10 and x2=50 +/- 2.5?

• @Glen_b Thanks. I re-edit the question and wish now it is more clear. – Hsiang Hung May 24 '17 at 16:37

For a sample of size $n$ the empirical CDF will be within $\varepsilon$ of the true CDF with a confidence level of $1- \alpha,$ where
$$\varepsilon =\sqrt{\left( \frac{1}{2n} \right) \ln \left( \frac{2}{\alpha} \right)}$$
For $n=1000$ and a confidence level of 95% ( $\alpha = 0.05$), $\varepsilon \approx 0.0429$
• This is a good answer, and very helpful. However, I see a potential problem. If we are plotting $\hat F$, these bounds are "vertical". The confidence bounds on the quantiles however would go "horizontally". But the DKW inequality doesn't depend on $x$, hence for percentiles close to 1 (say $p=.99$) we can never get an upper bound on the quantile using this approach. Am I making any sense? Do you have any ideas on how to handle this? – knrumsey May 26 '17 at 19:21