I am wondering why it all.equal()does not return TRUE for the following data:
Like.prob = dbinom(x = 0:2, size = 2, prob = .7)
sim.obs = rbinom(n = 1e6, size = 2, prob = .7)
sim.Like.prob = unname( table(sim.obs) / 1e6 )[1:3]
all.equal(Like.prob, sim.Like.prob, tolerance = .01)
source
share