I am trying to figure out a way to run a hypothesis test based on binomially distributed random variable, using R.
I have a control sample with size 1000. Random variable is binary. The probability if successes found in this sample is 1.0., i.e., all 1000 values equal one.
I have a test sample of size 100, where the probability estimate of successes is 0.98, i.e., there are 98 ones and 2 zero.
I wish to check whether 98 out of 100 is probable given a prior prob of 1.0.
What I want to do is: sum(dbinom(x = c(0:98), size = 100, prob = 1.0, log = FALSE)), i.e., I calculate a prob integral over a support in the left tail.
However I get zero response, since (https://en.wikipedia.org/wiki/Binomial_distribution) 1 - p = 0; and n - k = 0.
Question: I clearly see that sample estimate of probability equal one allows for 0.98 probability in another sample. H0 of no difference should hold here. However, formal test does not work for this limit case. Is there a workaround to run the hypothesis test?