I have the mtcars dataset
What I want is to make a simulation using a Poisson distribution
The basic idea is to simulate hp using rpois()
and compare it to the rest of the cars to see how many times one car has a lower hp than the other. That way I can have the probability that a car has a lower hp than the rest of the cars. I am using this example for simplicity in reality I am using golf players and base on their average score I want to know what is the probability to win the tournament
I can test the probability of one car has less hp than another by using their score
n1 = 93
n2 = 100
sum(rpois(1000, n1) < rpois(1000, n2))/1000
In this case, I am testing Mazda RX4 and Datsun 710 I would like a way to find this probability but using the whole sample, in other words, how many times Mazda RX4 has less hp from the Poisson simulation than the rest of the cars in the sample