Hello! I have a very large dataset of individual responses and I have an estimation of the likelihood of a specific response (yes/no). It was suggested that I could use the rbinom
package to simulate the responses for the individual records using the known population probability (i.e.: the likelihood that the individuals say yes is 32%). How would I go about doing this? I'm honestly at a loss and have been trying to figure this out for longer than I care to admit. I've tried researching sensitivity analysis (which is how this was presented), binomial distributions, probabilistic sensitivity analysis, but I'm still stuck on the basic starting point. The workflow presented was: define population probability as p1=32% > this approximates a binomial distribution B(n, p1) where n is the number of observations > use these parameters to simulate random outcomes for each individual/household > aggregate to county/specific geography. How do I set this up? Do I use the formula to create a new variable in the dataset such as:
mydata$new_var <- rbinom(mydata, sum(weight), .32)