twenty_rule: Function to determine severity in a specific area based on...

Description Usage Arguments Details Value Examples

Description

Function to determine severity in a specific area based on the 20 percent rule.

Usage

1
twenty_rule(data, col_score, col_label, name_final_score, col_agg, col_value)

Arguments

data

data.frame containing the data to be analysed.

col_score

character string specifying the name the column with scores

col_label

character string specifying the name the column with the labels to be applied to the choices

name_final_score

character string specifying the name score variable to be filtered from col_score. The values of col_score for name_final_score must be convertible to integers between 1 and 5.

col_agg

character string specifying the name the column

col_value

character string specifying which column should be used to aggregate the data. This is is typically an administrative unit (e.g. province, region, departement, admin2, etc.)

Details

The 20 percent rule states that "an area is classified as the most severe phase that affects at least 20 percent of the population", based on the percentage of population in each of the five severity phases.

The 20 percent rule is based on the Pareto principale

Value

a dataframe with the results of the 20 percent rule.

Examples

1
2
3
4
5
6
7
8
9
WSI_score_admin2 <- agg_score(data = WSC::bfa_msna_2020, context = "bfa_2020",
                              context_AP = WSC::context_AP,
                              WSC_AP = WSC::WSC_AP, agg_level = "admin2",
                              WIS_water = WSC::WIS_water, WIS_sanitation = WSC::WIS_sanitation,
                              WIS_final = WSC::WIS_final)

twenty_rule(data = WSI_score_admin2, col_score = "indicator",
            col_label = "choice", name_final_score = "score_final",
            col_agg = "admin2", col_value = "value")

ElliottMess/WSC documentation built on Jan. 8, 2021, 12:42 a.m.