set.seed(42) # set seed for repeatability
# Data for use in example
matU <- matrix(c(
0.1, 0.0,
0.2, 0.4
), byrow = TRUE, nrow = 2)
# Example of use to calculate 95% CI of life expectancy
compute_ci_U(
mat_U = matU, sample_size = 10, FUN =
Rage::life_expect_mean
)
# Example of use to calculate 95% CI of generation time and show the
# distribution of those bootstrapped estimates
xx <- compute_ci_U(
mat_U = matU, sample_size = 100, FUN =
Rage::life_expect_mean, dist.out = TRUE
)
summary(xx$quantiles)
hist(xx$estimates)
Run the code above in your browser using DataLab