Functions for computing residuals from the observed life expectancy and MCMC estimation, and fitting a local polynomial regression.
1 2 3
Directory with the MCMC estimation. In
Number of (unthinned) iterations to be discarded. In
Residuals can be computed outside of the
The Bayesian hierarchical model for life expectancy uses a lowess curve as a multiplier of the variance. The dataset is stored in the package as the
loess_sd dataset. These functions can be used to re-compute this
loess_sd dataset. In such a case, the simulation should be run with the argument
constant.variance = TRUE (in
The residuals are computed for each country as the absolute differences between the observed life expectancy increases and the mean of the estimated double logistic function at the corresponding life expectancy level.
compute.residuals returns a data frame with columns ‘x’ (life expectancy levels) and ‘y’ (absolute residuals).
compute.loess also returns a data frame with columns ‘x’ and ‘y’, where ‘x’ is the same as before (with added a minimum and maximum) and ‘y’ is the local polynomial fit with constant tails.
1 2 3 4 5 6 7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.