View source: R/compute-mpi-from-profile.R
| compute_mpi_from_profile | R Documentation |
Internal implementation used by compute_mpi.
Not exported. Use compute_mpi directly.
compute_mpi_from_profile(
.data,
deprivation_profile,
...,
by = character(0),
mpi_specs = NULL,
include_deprivation_matrix = TRUE,
weight = NULL,
strata = NULL,
cluster = NULL,
fpc = NULL,
survey_design = NULL,
inference = FALSE,
ci_level = 0.95
)
.data |
A tidy data frame where each row is the unit of analysis. |
deprivation_profile |
A named list of data frames produced by
|
... |
Extra columns (tidyselect) to carry through into the deprivation matrix. Not used for grouping. |
by |
Pre-resolved character vector of grouping column names. Populated
by |
mpi_specs |
MPI specifications from |
include_deprivation_matrix |
Whether to include deprivation matrices. |
weight, strata, cluster, fpc, survey_design, inference, ci_level |
Survey
design arguments; forwarded from |
specs <- define_mpi_specs(
system.file("extdata", "global-mpi-specs.csv", package = "mpindex"),
uid = "uuid"
)
deprivation_profile <- list()
deprivation_profile$drinking_water <- define_deprivation(
df_household,
indicator = drinking_water,
cutoff = drinking_water == 2,
mpi_specs = specs
)
# ... (define remaining indicators) ...
## Not run:
mpi_result <- compute_mpi_from_profile(
df_household, deprivation_profile, mpi_specs = specs
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.