Learn R Programming

bayesTFR (version 4.2-0)

tfr.trajectories.plot: Output of Posterior Distribution of TFR Trajectories

Description

The functions plot/tabulate the posterior distribution of TFR trajectories for a given country, or for all countries, including their median and given probability intervals.

Usage

tfr.trajectories.plot(tfr.pred, country, pi = c(80, 95), 
    half.child.variant = TRUE, nr.traj = NULL, 
    adjusted.only = TRUE, typical.trajectory = FALSE, 
    mark.estimation.points = FALSE,
    xlim = NULL, ylim = NULL, type = 'b', xlab = 'Year', ylab = 'TFR', 
    main = NULL, lwd = c(2, 2, 2, 2, 2, 1), 
    col=c('black', 'green', 'red', 'red', 'blue', '#00000020'),
    show.legend = TRUE, add = FALSE, ...)
	
tfr.trajectories.plot.all(tfr.pred, 
    output.dir = file.path(getwd(), 'TFRtrajectories'),
    output.type = "png", main = NULL, verbose = FALSE, ...)
	
tfr.trajectories.table(tfr.pred, country, pi = c(80, 95), 
    half.child.variant = TRUE)

Arguments

Rdversion

1.1

Details

tfr.trajectories.plot plots posterior distribution of TFR trajectories for a given country. tfr.trajectories.table gives the same output as a table. tfr.trajectories.plot.all creates a set of graphs (one per country) that are stored in output.dir.

The median and given probability intervals are computed using all available trajectories. Thus, nr.traj does not influence those values - it is used only to control the number of trajectories plotted.

See Also

bayesTFR.prediction

Examples

Run this code
sim.dir <- file.path(find.package("bayesTFR"), "ex-data", "bayesTFR.output")
pred <- get.tfr.prediction(sim.dir)
tfr.trajectories.plot(pred, country="Burkina Faso", pi=c(80, 95))
tfr.trajectories.table(pred, country="Burkina Faso", pi=c(80, 95))

Run the code above in your browser using DataLab