Genome...nePvals(3pm)
π Genome...nePvals(3pm) β aka CombinePvals π
User Contributed Perl Documentation Β· Genome...nePvals(3pm)
okay bestie, sit down, hydrate, because this one is a banger. it's the manual page for CombinePvals, a Perl module that does one very specific slay: it takes a whole pile of p-values from separate tests and smooshes them into one single aggregate number. yes queen, statistical alchemy. π§ͺβ¨
πΈ NAME πΈ
CombinePvals β combining probabilities from independent tests of significance into a single aggregate figure. it's giving many tests, one verdict. π
β¨ SYNOPSIS β¨
use CombinePvals;
my $obj = CombinePvals->new ($reference_to_list_of_pvals);
my $pval = $obj->method_name;
my $pval = $obj->method_name (@arguments);
so you use it, you make an object with a reference to your list of p-vals, and then you call whatever method you want. some methods take @arguments, some just vibe with zero args. that's it, that's the whole flow. π«Ά
π¦ DESCRIPTION π¦
okay so picture this: you've got a bunch of different kinds of tests, and/or separate instances of the same kind of test, all aimed at one particular null hypothesis. and every single one of them hands you back a p-value. so now what?? how do you properly condense this whole list of probabilities into ONE value so you can actually make a statistical inference β like, do we reject the null hypothesis or not? π
this problem got examined heavily starting around the 1930s, and back then a whole bunch of mathematical contintencies got treated, like:
- dependence vs. independence of tests
- optimality
- inter-test weighting
- computational efficiency
- continuous vs. discrete tests, and combinations thereof
- etc.
there is a quite large mathematical literature on this topic (peep REFERENCES below, it's a whole reading list) and any one particular situation might incur some of the above subtleties. this package concentrates on some of the more straightforward scenarios, and it furnishes various methods for combining p-vals. the main consideration will usually be the trade-off between the exactness of the p-value (according to strict frequentist modeling) and the computational efficiency β or honestly, whether it's even feasible at all. so pick your tests with that factor in mind, bestie. π
also, heads up: this scenario of combining p-values (many tests of a single hypothesis) is fundamentally different from the scenario where a given hypothesis is tested multiple times. that latter instance usually calls for some method of multiple testing correction. do not mix these up, i'm begging. π
π REFERENCES π
here's an abbreviated list of the substantive works on the topic of combining probabilities. scholarly era.
- Birnbaum, A. (1954) Combining Independent Tests of Significance, Journal of the American Statistical Association 49(267), 559-574.
- David, F. N. and Johnson, N. L. (1950) The Probability Integral Transformation When the Variable is Discontinuous, Biometrika 37(1/2), 42-49.
- Fisher, R. A. (1958) Statistical Methods for Research Workers, 13-th Ed. Revised, Hafner Publishing Co., New York.
- Lancaster, H. O. (1949) The Combination of Probabilities Arising from Data in Discrete Distributions, Biometrika 36(3/4), 370-382.
- Littell, R. C. and Folks, J. L. (1971) Asymptotic Optimality of Fisher's Method of Combining Independent Tests, Journal of the American Statistical Association 66(336), 802-806.
- Pearson, E. S. (1938) The Probability Integral Transformation for Testing Goodness of Fit and Combining Independent Tests of Significance, Biometrika 30(12), 134-148.
- Pearson, E. S. (1950) On Questions Raised by the Combination of Tests Based on Discontonuous Distributions, Biometrika 37(3/4), 383-398.
- Pearson, K. (1933) On a Method of Determining Whether a Sample Of Size N Supposed to Have Been Drawn From a Parent Population Having a Known Probability Integral Has Probably Been Drawn at Random Biometrika 25(3/4), 379-410.
- Van Valen, L. (1964) Combining the Probabilities from Significance Tests, Nature 201(4919), 642.
- Wallis, W. A. (1942) Compounding Probabilities from Independent Significance Tests, Econometrica 10(3/4), 229-248.
- Zelen, M. and Joel, L. S. (1959) The Weighted Compounding of Two Independent Significance Tests, Annals of Mathematical Statistics 30(4), 885-895.
π AUTHOR π
Michael C. Wendl
mwendl@wustl.edu
Copyright (C) 2009 Washington University
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
π GENERAL REMARKS ON METHODS π
the available methods are listed below. every single one of these computational techniques assumes that the tests β and their associated p-values β are independent of one another, and none of them considers any form of differential weighting. so like, no favoritism between your tests. they're all equal in this house. π
π CONSTRUCTOR METHODS π
these methods return an object in the CombinePvals class.
new
this is the usual object constructor, bestie. it takes a mandatory, but otherwise un-ordered (reference to a) list of the p-values you got from your set of independent tests.
my $obj = CombinePvals->new ([0.103, 0.078, 0.03, 0.2,...]);
and yes, the method checks to make sure all your elements are actual p-values β meaning they're real numbers, and they're bounded by 0 and 1. so if you try to sneak a 1.7 in there it WILL clock you. π΅οΈββοΈβ¨
π§ EXACT ENUMERATIVE PROCEDURES FOR STRICTLY DISCRETE DISTRIBUTIONS π§
when all the individual p-vals are derived from tests based on discrete distributions, the "standard" continuum methods cannot be used in the strictest sense. both Wallis (1942) and Lancaster (1949) discuss the option of full enumeration β which will only be feasible when there are a limited number of p-values and their range is not too large. feasibility experiments are suggested, depending upon the type of hardware and size of calculation. basically: check if your machine can handle it before you commit. π
exact_enum_arbitrary
this routine is designed for combining p-values from completely arbitrary discrete probability distributions. it takes a list-of-lists data structure, where each list is the probability tails ordered from most extreme to least extreme (i.e. as a probability cumulative density function) associated with each individual test. however, the ordering of the lists themselves is not important β they can show up in any order, no biggie.
for instance, Wallis (1942) gives the example of two binomials: a one-tailed test having tail values of 0.0625, 0.3125, 0.6875, 0.9375, and 1, and a two-tailed test having tail values 0.125, 0.625, and 1. we would then call this method using
my $pval = $obj->exact_enum_arbitrary (
[0.0625, 0.3125, 0.6875, 0.9375, 1],
[0.125, 0.625, 1]
);
the internal computational method is relatively straightforard and described in detail by Wallis (1942). note that this method does "all-by-all" multiplication, so it is the least efficient β although entirely exact. so like, it's the queen who does everything perfectly but takes forever to get ready. π
exact_enum_identical
this routine is designed for combining a set of p-values that all come from a single probability distribution.
NOT IMPLEMENTED YET
yeah bestie. it's not there yet. do not come for me. π
π¦ TRANSFORMS FOR CONTINUOUS DISTRIBUTIONS π¦
the mathematical literature furnishes several straightforward options for combining p-vals if all of the distributions underlying all of the individual tests are continuous. (key word: all. every single one. don't be sneaky with a discrete one in the mix. π)
fisher_chisq_transform
this routine implements R.A. Fisher's (1958, originally 1932) chi-square transform method for combining p-vals from continuous distributions, which is essentially a CPU-efficient approximation of K. Pearson's log-based result (see e.g. Wallis (1942) pp 232). note that the underlying distributions are not actually relevant, so no arguments are passed. β¨
my $pval = $obj->fisher_chisq_transform;
this is certainly the fastest and easiest method for combining p-vals, but its accuracy for discrete distributions will not usually be very good. for such cases, an exact or a corrected method are better choices. so like, know your data before you pick your method, okay? π«Ά
πΈ CORRECTION PROCEDURES FOR DISCRETE DISTRIBUTIONS: LANCASTER'S MODELS πΈ
okay so here's the tea bestie: enumerative procedures? they get slow SO fast. like, the second the number of tests grows or the support of each test gets big, it's over, it's giving computational meltdown π. so people came up with a whole bunch of procedures to patch up the methodologies that were designed for continuum testing β mostly under the umbrella of what we call continuity corrections.
the whole idea? basically you "spread" discrete data out into a pseudo-continuous configuration, as appropriately as you possibly can, and then you hit it with the standard transforms. does the accuracy vary? oh absolutely. and you should suitably establish it in each case, no cap. don't just assume it's fine. β¨
The methods in this section are due to H.O. Lancaster (1949), who discussed two corrections based upon the idea of describing how a chi-square transformed statistic varies between the points of a discrete distribution. Unfortunately, these methods require one to pass some extra information to the routines, i.e. not only the CDF (the p-val of each test), but the CDF value associated with the next-most-extreme statistic. These two pieces of information are the basis of interpolating. For example, if an underlying distribution has the possible tail values of 0.0625, 0.3125, 0.6875, 0.9375, 1 and the test itself has a value of 0.6875, then you would pass both 0.3125 and 0.6875 to the routine. In all cases, the lower value, i.e. the more extreme one, precedes higher value in the argument list. While there generally will be some extra inconvenience in obtaining this information, the accuracy is much improved over Fisher's method.
π¦ lancaster_mean_corrected_transform
This method is based on the mean value of the chi-squared transformed statistic.
my $pval = $obj->lancaster_mean_corrected_transform (@cdf_pairs);
its accuracy is good, like genuinely, but heads up bestie β the method is not strictly defined if one of the tests has either the most extreme or second-to-most-extreme statistic. so watch out for that edge case, she's a little unhinged π
π lancaster_median_corrected_transform
This method is based on the median value of the chi-squared transformed statistic.
my $pval = $obj->lancaster_median_corrected_transform (@cdf_pairs);
its accuracy may sometimes be not quite as good as when using the average, but the method is strictly defined for all values of the statistic. so like, slightly less slay on precision but she shows up for every single value and that's iconic honestly π
π lancaster_mixed_corrected_transform
This method is a mixture of both the mean and median methods. Specifically, mean correction is used wherever it is well-defined, otherwise median correction is used.
my $pval = $obj->lancaster_mixed_corrected_transform (@cdf_pairs);
this will be a good way to handle certain cases. best of both worlds energy fr fr π«Ά
π additional methods
The basic functionality of this package is encompassed in the methods described above. However, some lower-level functions can also sometimes be useful. these are the deep cuts, the b-sides, the iykyk tier π§
β exact_enum_arbitrary_2
Hard-wired precursor of exact_enum_arbitrary for 2 distributions. Does no pre-checking, but may be useful for comparing to the output of the general program.
β¨ exact_enum_arbitrary_3
Hard-wired precursor of exact_enum_arbitrary for 3 distributions. Does no pre-checking, but may be useful for comparing to the output of the general program.
π binom_coeffs
Calculates the binomial coefficients needed in the binomial (convolution) approximate solution.
$pmobj->binom_coeffs;
the internal data structure is essentially the symmetric half of the appropriately-sized Pascal triangle. considerable memory is saved by not storing the full triangle. lowkey a flex π
and that's a wrap on this part bestie!! π this page came from the perl v5.30.3 docs, dated 2020-11-06, and lives under the name Genome...nePvals(3pm) β go forth and correct those discrete distributions, you absolute icon πΈπ¦π
π¦ where this page comes from
- debian bookworm: libgenome-model-tools-music-perl 0.04-5 Β· LGPL-3.0-only
- debian trixie: libgenome-model-tools-music-perl 0.04-5 Β· LGPL-3.0-only
- ubuntu jammy: libgenome-model-tools-music-perl 0.04-5 Β· LGPL-3.0-only
- ubuntu noble: libgenome-model-tools-music-perl 0.04-5 Β· LGPL-3.0-only
- ubuntu resolute: libgenome-model-tools-music-perl 0.04-5 Β· LGPL-3.0-only
- ubuntu stonking: libgenome-model-tools-music-perl 0.04-5 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms