I have 10 p-values. How do I calculate the collective probability of this happening?
- User
I have 10 p-values. How do I calculate the collective probability of this happening?
- Assistant
To provide a clear answer, I need a bit more context about what you mean by "collective probability" of the 10 p-values. Here are some common scenarios and how to approach them:
- User
joint probability but all the experiments are independent
- Assistant
- User
Show how to do Fisher's method to get a p-value given a list of p-values, each for a different experiment, all experiments are independent. Write in Python.
- Assistant
Certainly! Here's a Python example that uses Fisher's method to combine a list of independent p-values into a single combined p-value.
Fisher's method formula recap:
Given p-values ({p_i}_{i=1}^k),
[ X = -2 \sum_{i=1}^{k} \ln(p_i) ]
Under the null hypothesis, (X) follows a chi-square distribution with (2k) degrees of freedom.
Combined p-value (p_{\text{combined}} = P(\chi^2_{2k} \geq X)).
- User
Convert to TypeScript
- Assistant
Certainly! Below is the TypeScript version of Fisher's method to combine independent p-values.
Notes:
- TypeScript (like JavaScript) does not have built-in statistical distributions.
- You can use a library like or to evaluate the chi-square survival function (upper tail probability).