EDIT: rephrased question for clarity of what I was wanting to achieve.
I have an observed dataset from which I want to use some information to feed into a Monte Carlo simulation. I'm using R for this study.
e.g. 8/8 individuals have a particular characteristic in my observed dataset.
What I want to do is use the sampling distribution from this observed data to choose some possible population proportions to feed into a random number generator, whereby I can then generate some simulated counts (where I also need to use a larger denominator).
The observed data and the 95% confidence interval are as follows:
binom.test(8, 8)
## gives point estimate of 1 and 95% CI 0.63, 1
I would then want to take (e.g.) 1000 random draws from this sampling distribution to feed into a random binary outcome generator for a larger denominator (e.g. 12 trials per iteration). Let’s say the first random draw was a 0.75 chance of having an event (code below is just illustrating a single iteration):
set.seed(456)
rbinom(1, 12, 0.75)
## Gives a count of 11 events out of 12 for this single iteration.
My question then is how to get R to draw the probabilities from the observed data’s sampling distribution (i.e. 95% of these drawn probabilities should fall between 0.63 and 1, with a shape as defined by the underlying statistical theory), which I can then use to generate random counts with a larger denominator (probably using rbinom).
EDIT: My original post was more convoluted and confusing: I hadn’t fully thought through the implications of rbinom using a population parameter, even though I was pretty sure that this was the source of my "problem" with rbinom. Thanks to DavidRobinson and DWin for comments/answers that clarified my answer as well as my revised question...