if (FALSE) { # rlang::is_installed("bbmle")
# load libraries for models and data
library(bbmle)
# generate data
x <- 0:10
y <- c(26, 17, 13, 12, 20, 5, 9, 8, 5, 4, 8)
d <- data.frame(x, y)
# fit model
fit <- mle2(y ~ dpois(lambda = ymean),
start = list(ymean = mean(y)), data = d
)
# summarize model fit with tidiers
tidy(fit)
}
Run the code above in your browser using DataLab