View source: R/user_interface.R
do_global_all_women_run | R Documentation |
Do married and unmarried runs of the global model, and produce results. Then combine to produce all women results.
do_global_all_women_run(
run_desc = "",
age_group = "15-49",
estimation_iterations = 3,
burn_in_iterations = 1,
steps_before_progress_report = 4,
thinning = 2,
chain_nums = 1:3,
set_seed_chains = 1,
run_in_parallel = isTRUE(length(chain_nums) > 1),
input_data_folder_path = system.file("extdata", package = "FPEMglobal"),
data_csv_filename = paste0("data_cp_model_all_women_", age_group, ".csv"),
region_information_csv_filename = "country_and_area_classification.csv",
denominator_counts_csv_filename = paste0("number_of_women_", age_group, ".csv"),
countries_for_aggregates_csv_filename = "countries_mwra_195.csv",
countries_in_CI_plots_csv_filename = "countries_mwra_195.csv",
special_aggregates_name = NULL,
start_year = 1970.5,
end_year = 2030.5,
years_change = matrix(c(1990.5, 2000.5, 2000.5, 2018.5, 2018.5, 2030.5, 2012.5, 2018.5,
2012.5, 2020.5, 2012.5, 2017.5), ncol = 2, byrow = TRUE),
years_change2 = matrix(c(2005.5, 2010.5, 2015.5, 2000.5, 2005.5, 2010.5, 1995.5,
2000.5, 2005.5, 1990.5, 1995.5, 2000.5, 1990.5, 2000.5, 2010.5), ncol = 3, byrow =
TRUE),
plot_barchart_years = c(floor(start_year), floor(median(c(start_year, end_year))),
floor(end_year)),
plot_CI_changes_years = c(floor(start_year), floor(end_year)),
make_any_aggregates = TRUE,
make_all_bar_charts = TRUE,
plot_maps_shapefile_folder = NULL,
plot_maps_years = floor(median(c(start_year, end_year))),
data_info_plot_years = c(1990, 2000, 2010),
adjust_medians = TRUE,
run_name_override_married = NULL,
run_name_override_unmarried = NULL,
run_name_override_all_women = NULL,
model_diagnostics = TRUE,
include_AR = TRUE,
age_ratios_age_total_run_name_prefix = NULL,
age_ratios_age_total_married_run_name = NULL,
age_ratios_age_total_unmarried_run_name = NULL,
age_ratios_age_total_all_women_run_name = NULL,
age_ratios_age_total_married_output_folder_path = NULL,
age_ratios_age_total_unmarried_output_folder_path = NULL,
age_ratios_age_total_all_women_output_folder_path = NULL,
age_ratios_age_total_denominator_counts_csv_filename = "number_of_women_15-49.csv",
age_ratios_age_total_denominator_counts_folder_path = NULL,
verbose = FALSE
)
run_desc |
Character. Brief note to be appended to the
auto-generated |
age_group |
Character. The age group for which a run of the
model is desired, specified in the format “xx-yy”,
where “xx” is the start age, “yy” is the end
age, e.g., |
estimation_iterations |
Numeric. Number of MCMC iterations
that should be saved. This is before
|
burn_in_iterations |
Numeric. Number of MCMC iterations that should be run as burn-in before starting to save them. |
steps_before_progress_report |
Numeric. The number of times progress should reported during MCMC sampling. |
thinning |
Numeric. The actual number of iterations saved is
|
chain_nums |
Numeric. The number of MCMC chains to run,
as a sequence. E.g., for three chains use
|
set_seed_chains |
Set the random seed passed to
|
run_in_parallel |
Logical. Determines if MCMC chains are run in parallel. Parallel running requires package doParallel or doMC.
Defaults to serial running if |
input_data_folder_path |
File path to folder containing
all input data (except any map shapefiles). If
|
data_csv_filename |
Filename of the ‘.csv’ file containing country-level prevalence data. See “Details”. |
region_information_csv_filename |
Filename of the ‘.csv’ file containing classifications of countries in sub-regions, regions, etc. See “Details”. |
denominator_counts_csv_filename |
File path. Filepath to ‘.csv’
file with denominator counts (married and unmarried) for this
|
countries_for_aggregates_csv_filename |
Name of the ‘.csv’ file listing countries that will be used in constructing country aggregates. |
countries_in_CI_plots_csv_filename |
Name of ‘.csv’ file
that lists the countries to be included in the main
country-level indicator plots. These are the plots saved in
‘ |
special_aggregates_name |
Character vector of names
(not filenames) of any speical aggregates
desired. There must be a corresponding file with name
‘ |
start_year |
Estimates and projections are produced for a specified time interval. This is the start year of that interval. |
end_year |
Estimates and projections are produced for a specified time interval. This is the end year of that interval. |
years_change |
A two-column matrix giving the year pairs (as rows) between which probabilistic estimates of changes in the indicators are desired. |
years_change2 |
A three-column matrix giving the year triples (as rows) among which to compute probabilistic estimates of change-in-changes. |
plot_barchart_years |
Vector of years for which bar charts
should be produced. These are saved to
‘ |
plot_CI_changes_years |
Vector of length two (if longer, only
the first and last elements are used). Declares the years to
be used to make the “fish bone” plots, i.e., the plots
appearing in files
‘ |
make_any_aggregates |
Logical. Should country aggregates of any kind (including default aggregates) be produced? |
make_all_bar_charts |
Logical. Produce barcharts? If
|
plot_maps_shapefile_folder |
Path to directory containing
shapefiles for maps. Only needed if |
plot_maps_years |
Vector of years for which maps are desired;
the full set of maps are produced for each of the years
listed. These must be in the range of |
adjust_medians |
Logical. Should adjusted medians outputs be produced in addition to unadjusted outputs? |
model_diagnostics |
Logical; should convergence diagnostics
and WAIC be computed? These are not re-done if the folder ‘ |
include_AR |
Logical; should the auto-regressive component of the model be estimated. Used mainly for testing. |
age_ratios_age_total_run_name_prefix |
Run name prefix for married, unmarried, and all women runs. Results will be searched for in ‘output/ |
age_ratios_age_total_married_run_name |
Run name of the married 15–49 run to use as the denominator for age ratios. |
age_ratios_age_total_unmarried_run_name |
Run name of the unmarried 15–49 run to use as the denominator for age ratios. |
age_ratios_age_total_all_women_run_name |
Run name of the all women 15–49 run to use as the denominator for age ratios. |
age_ratios_age_total_married_output_folder_path |
File path to output directory of the married 15–49 run to use to make age ratios. |
age_ratios_age_total_unmarried_output_folder_path |
File path to output directory of the unmarried 15–49 run to use to make age ratios. |
age_ratios_age_total_all_women_output_folder_path |
File path to output directory of the all women 15–49 run to use to make age ratios. |
age_ratios_age_total_denominator_counts_csv_filename |
Name of
the ‘.csv’ file containing estimates and projections of
the number of women by marital status, age, and year, for the
age group 15–49. Only used if |
age_ratios_age_total_denominator_counts_folder_path |
Path to
|
verbose |
Logical; print lots and lots of messages about progress? |
A “run name” is assigned to each run of the model to identify it. The
run name is used to name the directory in which outputs are stored and the
filenames of certain results such as tables and plots. By default, it is
auto-generated by concatenating the date-time
(via format(Sys.time(), "%y%m%d_%H%M%S")
),
marital group, age group and (optionally)
run_desc
. If run_desc
does not afford enough control,
run_name_override
can be used to completely override
auto-generation. The function returns the run name as a character string.
See system.file("extdata", "data_cp_model_all_women_15-49.csv")
for
how the prevalence data input should be formatted. Assume all columns are
required.
See system.file("extdata", "country_and_area_classification.csv")
for
how the country classification file should be formatted. Assume all columns
are required.
Typical values of the MCMC control parameters for a “full” model run are:
estimation_iterations
ceiling(5e5 / nchains)
, where nchains is the number of chains (i.e., length(chain_nums)
).
burn_in_iterations
2e4
thinning
30
A list of run names for married, unmarried, and all women
runs, returned invisibly. Results are saved to
‘output_folder_path
’.
Mark Wheldon, Andrew Tait
do_global_run
for just married or unmarried women runs.
vignette("FPEMglobal_Intro")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.