knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file())
# knitr::opts_knit$get("root.dir")  # alternative to the previous line
# the default autosave location will depend on this being setup
options(warn=-1)

1. Fit models and obtain samples for all women

Obtaining results for all women entails running the in-union and not-in-union model. In this case, fit_fp_c returns a named list of fits.

library(fpemlocal)
fitlist <- fit_fp_c(
  is_in_union = "ALL",
  division_numeric_code = 4,
  first_year = 1970,
  last_year = 2030
)
fitlist %>% names

2. Calculate point estimates for indicators

resultlist <- calc_fp_c(fitlist)
resultlist %>% names

3. Plot the point estimates and survey data

plots <- plot_fp_c(
  fitlist,
  resultlist,
  indicators = c(
    "contraceptive_use_modern"
    )
  )
plots %>% names
plots$ALL


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