tfr.median.set.all {bayesTFR}R Documentation

Editing median for estimation and projections.


These functions are to be used by expert analysts. They allow to change the estimation and projection medians to specific values or to the WPP values.


tfr.median.set.all(sim.dir, country, values, years = NULL, 
    burnin = 0, thin = 1)

tfr.median.reset.estimation(sim.dir, countries = NULL), ..., verbose = TRUE)



Directory containing the prediction object.


Name or numerical code of a country.


Vector of country names or codes. If NULL, the reset is done for all countries.


Array of the new median values.


Numeric vector giving years which values correspond to. Ideally it should be of the same length as values.


Burnin to use when computing the estimation median.


Thinning interval to use when computing the estimation median.


Can be used to pass burnin thin to the underlying funcions.


Logical. If TRUE a progress of the adjustment is shown.


Expert analysts can use these functions to adjust both prediction and estimation medians. Estimation medians can only be adjusted if the simulation was performed with uncertainty = TRUE. In such a case years can include past time periods. By default a union of estimation and projection time periods is considered when matched to values.

Function shifts the median estimation of all countries so that they match the values in the tfr dataset of the corresponding WPP package. Argument burnin and thin should be passed to compute the estimation medians.

Function tfr.median.reset.estimation resets previous adjustments obtained using tfr.median.set.all. By default it resets adjustments for all countries.


Output is a list. If there are time periods matched to estimation, an object of class bayesTFR.mcmc.meta is included in the element meta. If there are time periods matched to years in prediction, then an object of class bayesTFR.prediction is included in the element pred.

Function returns the updated mcmc.set object.


Peiran Liu

See Also for shifting prediction medians to WPP values.

[Package bayesTFR version 7.4-2 Index]