mig.trajectories.plot {bayesMig}R Documentation

Output of posterior distribution of migration trajectories

Description

The functions plot/tabulate the posterior distribution of trajectories of net migration rates for a given location, or for all locations, including their median and given probability intervals.

Usage

mig.trajectories.plot(
  mig.pred,
  country,
  pi = c(80, 95),
  nr.traj = 50,
  mark.estimation.points = FALSE,
  xlim = NULL,
  ylim = NULL,
  type = "b",
  xlab = "Year",
  ylab = "Migration rate",
  main = NULL,
  lwd = c(2, 2, 2, 2, 1),
  col = c("black", "green", "red", "red", "#00000020"),
  show.legend = TRUE,
  add = FALSE,
  scale = FALSE,
  ...
)

mig.trajectories.plot.all(
  mig.pred,
  output.dir = NULL,
  output.type = "png",
  verbose = FALSE,
  ...
)

mig.trajectories.table(mig.pred, country, pi = c(80, 95), ...)

Arguments

mig.pred

Prediction object of class bayesMig.prediction.

country

Name or numerical code of a location. If it is a country, it can also be given as ISO-2 or ISO-3 characters.

pi

Probability interval (as percentage) to be included in the output. It can be a single number or a vector.

nr.traj

Number of trajectories to be plotted. If NULL, all trajectories are plotted, otherwise they are thinned evenly.

mark.estimation.points

Logical. If TRUE, points that were not used in the estimation are shown in a lighter color.

xlim, ylim, type, xlab, ylab

Graphical parameters passed to the plot function.

main

Main title for the plot(s). In mig.trajectories.plot.all any occurrence of the string “XXX” is replaced by the name of the appropriate country.

lwd, col

Vector of five elements giving the line width and color for: 1. observed data, 2. imputed values, 3. median, 4. quantiles, 5. trajectories.

show.legend

Logical controlling whether a legend should be drawn.

add

Logical controlling whether the trajectories should be plotted into a new graphic device (FALSE) or into an existing device (TRUE). One can use this argument to plot trajectories from multiple countries into one graphics.

scale

Logical. If TRUE, values are scaled to be “per population”, i.e. they are divided by pop.denom passed to run.mig.mcmc.

...

Additional graphical parameters. In addition, for mig.trajectories.plot.all any of the arguments of tfr.trajectories.plot can be passed here.

output.dir

Directory into which resulting plots are written. By default, the plots are saved into directory sim.dir/predictions/migTrajectories.

output.type

Type of the resulting plot files. Can be "png", "pdf", "jpeg", "bmp", "tiff", or "postscript".

verbose

Logical value. Switches log messages on and off.

Details

mig.trajectories.plot plots posterior distribution of trajectories of net migration rates for a given location. mig.trajectories.table gives the same output as a table. mig.trajectories.plot.all creates a set of graphs (one per location) 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 in the graphs.

Value

No return value.

See Also

mig.predict, summary.bayesMig.prediction

Examples

# See example in ?mig.predict


[Package bayesMig version 0.4-6 Index]