Skip to content

Commit

Permalink
Change percenile calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
benjello committed Aug 8, 2023
1 parent 72d380a commit b1963e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions openfisca_france_data/model/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ def formula(foyer_fiscal, period):
weight_foyers = foyer_fiscal('weight_foyers', period)
menage_ordinaire_foyers_fiscaux = foyer_fiscal('menage_ordinaire_foyers_fiscaux', period)
labels = arange(1, 11)
method = 2
decile, values = mark_weighted_percentiles(niveau_de_vie, labels, weight_foyers * menage_ordinaire_foyers_fiscaux, method, return_quantiles = True)
# Alternative method
# method = 2
# decile, values = mark_weighted_percentiles(niveau_de_vie, labels, pondmen, method, return_quantiles = True)
decile, values = weighted_quantiles(rfr, labels, weight_foyers * menage_ordinaire_foyers_fiscaux, return_quantiles = True)
# decile, values = weighted_quantiles(rfr, labels, weight_foyers * menage_ordinaire_foyers_fiscaux, return_quantiles = True)
return decile


Expand Down
2 changes: 1 addition & 1 deletion openfisca_france_data/model/survey_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class menage_ordinaire(Variable):
value_type = int
is_period_size_independent = True
default_value = True
default_value = 1
entity = Menage
definition_period = YEAR

Expand Down

0 comments on commit b1963e0

Please sign in to comment.