Computes the change in the total estimated population size
\(\hat\xi = \sum_i N_i^{\hat\alpha_i}\) when each observation (or country)
is dropped. This is a convenience wrapper around loo.
Usage
dfpopsize(model, ...)
# S3 method for class 'uncounted'
dfpopsize(model, by = c("obs", "country"), ...)Arguments
- model
A fitted
uncountedobject.- ...
Additional arguments passed to
loo.- by
Character:
"obs"(default) or"country".
Value
A named numeric vector. Each element is the change in \(\hat\xi\) when that unit is dropped (\(\hat\xi_{(-i)} - \hat\xi\)).
Examples
data(irregular_migration)
d <- irregular_migration[irregular_migration$year == "2019" & irregular_migration$sex == "Male", ]
fit <- estimate_hidden_pop(d, ~ m, ~ n, ~ N, method = "poisson",
gamma = 0.001, countries = ~ country_code)
dp <- dfpopsize(fit)
head(dp)
#> 1 2 3 4 5 6
#> 4006.95264 -157.03916 3460.55759 187.08577 542.66030 -30.66062
