# What is the relationship between quantile functions and p-values

Assume I have a quantile function for an arbitrary probability distribution for random variable x.

Would the x-value corresponding to the 99th percentile be the same as the x-value corresponding to a p-value of 0.01 (one-sided test, right tail)?

Details for my specific problem: I have fitted a gamma distribution to some experimental data and I am trying to calculate p-values (one-sided) for extreme observations in the right tail of the distribution. Since I have learned model parameters for the gamma distribution, I was hoping that I could use qgamma in R to calculate cutoffs for a given p-value significance threshold. Is this a sane thing to do?

-
What exactly are you trying to test and against what alternate hypothesis? – Jonathan Kariv Jun 29 '10 at 16:13
I have a sample distribution (to which I fit the gamma distribution) that corresponds to lengths of sequences identified at random (the random variable x is the length of sequence). In my case, longer sequences are highly unlikely to occur randomly, and I am trying to calculate p-values for these long sequences (which in my case appear in the far right tail of the sample distribution). The null hypothesis is that a given sequence was identified by chance, the alternative hypothesis is that the sequence was generated by a different, non-random process. – awesomo Jun 29 '10 at 17:24
Assigning a separate p-value to each future observation is a bit strange. Maybe it would make sense if one has a separate null hypothesis for each of them. However.... are you assuming the distribution of each of those is the fitted distribution? That would not take into account uncertainty resulting from the fact that it's fitted based on a finite sample. That's the sort of thing one does when one uses a t-distribution rather than a normal distribution when sampling from a population that is assumed to be normally distributed. – Michael Hardy Jun 30 '10 at 2:57