| write.projection.summary | R Documentation |
The function creates two files containing projection summaries, such as the median, mean, the lower and upper bound of the 80 and 90% probability intervals, respectively, the +/- 0.5 child variant and the constant variant. One file is in a user-friendly format, whereas the other is in a UN-specific format with internal coding of the time and the variants. In addition, a file containing some of the model parameters is created.
write.projection.summary(dir = file.path(getwd(), "bayesTFR.output"),
subdir = "predictions", output.dir = NULL, revision = NULL, adjusted = FALSE,
est.uncertainty = FALSE, ...)
dir |
Directory containing the prediction object. It should correspond to the |
subdir |
Subdirectory of |
output.dir |
Directory in which the resulting file will be stored. If |
revision |
UN WPP revision number. If |
adjusted |
Logical. By default the function writes summary using the original BHM projections. If the projection medians are adjusted (using e.g. |
est.uncertainty |
Logical. If |
... |
Additional arguments passed to the underlying functions. Here, argument |
The first file that the function creates is called ‘projection_summary_user_friendly.csv’ (or ‘projection_summary_user_friendly_adjusted.csv’ if adjusted=TRUE), it is a comma-separated table with the following columns:
country name
country code
name of the variant, such as “median”, “lower 80”, “upper 80”, “lower 95”, “upper 95”, “mean”, “-0.5child”, “+0.5child”, “constant”
e.g. “2005-2010”: TFR for the first time period. If est.uncertainty is TRUE, the first time period is the first observed time period. Otherwise it is the last observed one.
e.g. “2010-2015”: TFR for the second time period
further columns with TFR projections
The second file, called ‘projection_summary.csv’ (or ‘projection_summary_adjusted.csv’ if adjusted=TRUE), also comma-separated table, contains the same information as above in a UN-specific format:
revision number, passed to the function as an argument
variant identifier, extracted from the UN_variants dataset
country code
time identifier, extracted from the UN_time dataset
the total fertility rate for this variant, location and time period
The third comma-separated file, called ‘projection_summary_parameters.csv’ contains the following columns:
country name
country code
start period of TFR decline
TFR at the onset of the fertitility transition (median of the U_c parameter)
maximum decrement of TFR decline (median of the d_c parameter)
median of the end level of the fertility transition (\Delta_{c4} parameter)
2.5 percentile of the \Delta_{c4} distribution
97.5 percentile of the \Delta_{c4} distribution
period of the end decline, measured using the prediction median
Note that this file is not created if adjusted=TRUE.
This function is automatically called from the tfr.predict function, therefore in standard cases it will not be needed to call it directly.
Hana Sevcikova
convert.tfr.trajectories, tfr.predict
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.