Learn R Programming

bayesTFR (version 4.2-0)

write.projection.summary: Writing Projection Summary Files

Description

The function creates two files containing projection summaries, such as the median, 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.

Usage

write.projection.summary(dir = file.path(getwd(), "bayesTFR.output"), 
    output.dir = NULL, revision = NULL, adjusted = FALSE)

Arguments

dir
Directory containing the prediction object. It should correspond to the output.dir argument of the tfr.predict function.
output.dir
Directory in which the resulting file will be stored. If NULL the same directory is used as for the prediction.
revision
UN WPP revision number. If NULL it is determined from the corresponding WPP year: WPP 2008 corresponds to revision 13, every subsequent WPP increases the revision number by one. Used as a constant in the second file only.
adjusted
Logical. By default the function writes summary using the original BHM projections. If the projection medians are adjusted (using e.g. tfr.median.set), setting this argument to TRUE caus

file

  • projection_summary.csv
  • projection_summary_adjusted.csv
  • projection_summary_parameters.csv

code

adjusted=TRUE

itemize

  • country_name:

item

  • VarID:
  • LocID:
  • TimeID:
  • TFR:
  • country_code:
  • TF_time_start_decline:
  • TF_max:
  • TF_max_decrement:
  • TF_end_level:
  • TF_end_level_low:
  • TF_end_level_high:
  • TF_time_end_decline:

eqn

$\Delta_{c4}$

Details

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 name} country_code:{country code} variant:{name of the variant, such as median, lower 80, upper 80, lower 95, upper 95, -0.5child, +0.5child, constant} period1:{e.g. 2005-2010: TFR for the first time period} period2:{e.g. 2010-2015: TFR for the second time period} ...{further columns with TFR projections}

See Also

convert.tfr.trajectories, tfr.predict