R/mar_haz_define.R

Defines functions mar_haz_define

Documented in mar_haz_define

#' marriage hazard construct function (internal)
#'
#' @param start_year year of simulation start.
#' @param end_year year of simulation end
#' @param mar_prob list of data.frames of marriage probabilities by year (Starting at zero) thru maximum age
#' one for each cohort

mar_haz_define <- function(start_year, end_year, mar_prob) {

  cohorts <- cohort_construct(start_year = start_year, end_year = end_year)

    mar_haz_list  <- list()

    for (i in 1:cohorts[["n_cohorts"]]) {

      mar_haz_list[[i]] <- mar_prob[[i]][0:(end_year - (cohorts[["start_years"]][i])),"marrige_prob_perc"]

    }

  mar_haz_list
}
Joshua-Yukich/childmarriager documentation built on Oct. 9, 2020, 5:12 p.m.