Skip to contents

compute_composite is a generic function that calculates the composite indicators according to specified normalisation, missing management, weighting and aggregation methods.

Usage

compute_composite(
  indicator_list,
  norm_method = "binary",
  miss_method = 1,
  weight_method = "experts",
  aggr_method = "linear",
  cutoff = 0.95,
  expert_weights = NULL,
  ...
)

Arguments

indicator_list

list of outputs about each indicator computable for the target unit (e.g., company or contracting authority), as returned by ind_all().

norm_method

normalisation method (see normalise()).

miss_method

missing management method (see manage_missing()).

weight_method

weighting method (see get_weights()).

aggr_method

aggregation method (see aggregate()).

cutoff

threshold for dichotomising the indicators (when norm_method = "binary").

expert_weights

mean weights over a pool of anticorruption experts which express the relative impact of each indicator over the composite (these are originally expressed on a scale of 1 to 10)

...

optional arguments for mirt::mirt() function. See Details.

Value

indicator schema as from generate_indicator_schema()

Examples

if (FALSE) {
if (interactive()) {
  # sample of 100k contracts
  set.seed(12345)
  i <- sample(1:nrow(mock_data_core), size = 1e5)
  mock_sample0 <- mock_data_core[sort(i), ]

  # indicators for companies
  mock_sample <- tidyr::unnest(mock_sample0, aggiudicatari, keep_empty = TRUE)
  mock_sample_variants <- tidyr::unnest(mock_sample, varianti, keep_empty = TRUE)

  out_companies <- ind_all(
    data = mock_sample,
    data_ind8 = mock_sample_variants,
    emergency_name = "coronavirus",
    target_unit = "companies"
  )
  composite_companies <- compute_composite(
    indicator_list = out_companies,
    norm_method = "binary",
    miss_method = 0,
    cutoff = 0.99,
    weight_method = "experts",
    aggr_method = "linear"
  )
}
}