fit_fp_csub: Fit one country model

View source: R/fit_fp_c.R

fit_fp_csubR Documentation

Fit one country model

Description

Fits the family planning estimation model and returns samples and bias adjusted observations for respective run.

Usage

fit_fp_csub(
  is_in_union = "Y",
  division_numeric_code,
  first_year = NULL,
  last_year,
  surveydata_filepath = NULL,
  service_stats_filepath = NULL,
  subnational = FALSE,
  diagnostic = FALSE,
  params_to_save = c("mod.ct", "unmet.ct", "trad.ct", "mu.in", "logitratio.yunmet.hat.i"),
  nchains = 10,
  niter = 2500,
  nburnin = 500,
  nthin = max(1, floor((niter - nburnin) * nchains/2000))
)

Arguments

is_in_union

‘Character’ "Y" if women are in union.

division_numeric_code

‘Numeric’ A number associated with the country. See the data from divisions.

first_year

‘Numeric’ The first year of model estimates in output. The model will be fit to all data, including dates before this date if available.

last_year

‘Numeric’ The last year of model estimates in output. The model will be fit to all data, including dates after this date if available.

surveydata_filepath

‘Character’ Path to survey data. Survey data should be a .csv with the following format contraceptive_use.

service_stats_filepath

‘Character’

subnational

'‘Logical’ If TRUE runs the sub national model.

diagnostic

'‘Logical’ If TRUE saves the full jags output.

Value

‘List’

  1. posterior_samples ‘Numeric array’ An array of samples of dimension chains x samples x years x proportions.

  2. core_data ‘Data.frame’ The processed data associated with the model run from core_data.

References

https://github.com/FPcounts/FPEM

Examples

See the reposiotry url in references for detailed examples

FPRgroup/FPEMcountry documentation built on April 24, 2023, 4:32 p.m.