# Statistical test for sampling discrete objects from urn

I have data that looks like this:

  selected_genes <- c("A","X","Y")
pooled_genes <- c("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L",
"M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y",
"Z")


The question I want to answer is that if we pick 3 genes from pooled_genes how likely that selected_genes is obtained.

What's the appropriate statistical test to obtain p-value for that?

• Does the order of selected_genes play a role? Can genes be picked twice? Can selected_genes contain the same gene twice? Please extend your question, so that answers are either right or wrong and not depending on interpretation. Mar 14, 2018 at 7:29
• @Bernhard Thanks a lot. Order of selected genes doesn't matter. Yes the genes can be picked twice. No selected genes cannot contain the same gene twice. Mar 14, 2018 at 7:31
• Oh sorry for the second comment. As "A" is in the selected_genes but not in the pooled_genes, the answer is easy: It is not likely at all. Mar 14, 2018 at 7:31
• @Bernhard Can you elaborate. We (my boss) need a p-value to justify. Mar 14, 2018 at 7:32
• @neversaint, what Bernhard meant is that gene "A" in "selected_genes" does not occur in "pooled_genes", thus "A" cannot be picked, and the corresponding probability is zero.
– crlb
Mar 14, 2018 at 7:51

From the distribution and assigning probabilities of picking genes, $p_i$, $i \in \{A,B,...\}$, the p-value can be calculated given an observation.
• c("A","X","Y") is the observation. How can I get the p-value with R code? Mar 14, 2018 at 8:06