View source: R/plot_functions.R
tfr.estimation.plot | R Documentation |
Plot past TFR estimation results from a simulation that accounted for past TFR uncertainty.
tfr.estimation.plot(mcmc.list = NULL, country = NULL, sim.dir = NULL,
burnin = 0, thin = 1, pis = c(80, 95), plot.raw = TRUE,
grouping = "source", save.image = TRUE, plot.dir = "Estimation.plot",
adjust = TRUE, country.code = deprecated(), ISO.code = deprecated())
mcmc.list |
Object of class |
country |
Name or numerical code of a country. It can also be given as ISO-2 or ISO-3 characters. |
sim.dir |
Directory with the MCMC simulation results. |
burnin |
Burn-in for getting trajectories and quantiles. A positive burn-in |
thin |
Thin for getting trajectories and quantiles. Thinning level |
pis |
Probability interval. It can be a single number or an array of two numbers. |
plot.raw |
Whether raw data used for the estimation should be plotted. |
grouping |
If raw data is plotted, then grouping should be one of the categorical feature in the data, so that the color and shape of the raw data will differ for different groups. |
save.image |
Logical. Whether the resulting plot will be saved. |
plot.dir |
If |
adjust |
Logical. By default, if the estimation median is adjusted using e.g. |
country.code , ISO.code |
Deprecated arguments. Use argument |
tfr.estimation.plot
plots posterior distribution of past TFR estimations for a given country. It only works if uncertainty is considered in the MCMC process.
Peiran Liu, Hana Sevcikova
## Not run:
sim.dir <- tempfile()
mcmc.set <- run.tfr.mcmc(nr.chains = 1, iter = 10, output.dir = sim.dir,
replace.output = TRUE, uncertainty = TRUE)
tfr.estimation.plot(mcmc.set, "Nigeria", save.image = FALSE)
unlink(sim.dir, recursive = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.