R/run_cdf.R

Defines functions run_cdf

run_cdf = function(data) {
  wtmec4yr_adj_norm = NULL
  rm(list = c("wtmec4yr_adj_norm"))
  temp =
    data %>%
    dplyr::mutate(wt_norm = wtmec4yr_adj_norm / mean(wtmec4yr_adj_norm))

  svy_design =
    survey::svydesign(
      id = ~ masked_variance_pseudo_psu,
      strata = ~ masked_variance_pseudo_stratum,
      weights = ~ wt_norm,
      data = temp,
      nest = TRUE
    )
  survey::svycdf(~value, svy_design)$value
}

Try the mapnhanespa package in your browser

Any scripts or data that you put into this service are public.

mapnhanespa documentation built on June 2, 2026, 5:07 p.m.