# NOT RUN {
lambdahat <- with(ruge, weighted.mean(number, w = counts))
(N <- with(ruge, sum(counts)))
with(ruge, cbind(number, counts,
fitted = round(N * dpois(number, lam = lambdahat))))
# }
Run the code above in your browser using DataLab