Missing TeethΒΆ

Consider missing teeth among young German adults.

>>> from effectus import Effects
>>> from effectus.data import missing_teeth
>>> mteeth = Effects(missing_teeth())
>>> mteeth
<pareto present [0.917]: 1/5 causes => 2/3 effects [total βˆ†: 3.8 % points]>

Two thirds of all missing teeth can be found with only one fifth of all young German adults.

That information is stored in a dict for your convenience:

>>> mteeth.summary
{'causes': Fraction(1, 5),
 'effects': Fraction(2, 3),
 'gcd': Fraction(1, 15),
 'variability': 0.038371566735748826}

gcd is the greatest common denominator of causes and effects fractions.

variability is the total delta of the actual causes and effects to those in the dict.

>>> mteeth.ratio
0.917

The entropy of the missing teeth values falls below the threshold of the present pareto distribution where 20 percent of causes provoke 60 percent of effects.

Give me that observations of missing teeth constituting the two thirds of missing teeth:

>>> mteeth.few
<[20% => 67%] count: 184, mean: 6.929, stdev: 5.208>

We can select that group by a threshold value:

>>> majority_of_missing = mteeth.retrieve_effects(2/3)
>>> mteeth.separate_effects(2/3)
(4.0, 84, 94)

We need all young German adults with more than four missing teeth and another 84 with four missing teeth to let them represent at least 50 percent of all missing teeth.

The rule 50/5 says 50 percent of causes make up only for 5 percent of the total effects, meaning here 50 percent of people have only 5 percent of total missing teeth:

>>> mteeth.the_rule()
'Rule 66/20 [total βˆ†: 3.8 % points]'

One could simply check for rule 50/5 like:

>>> mteeth.attain_effects(0.05, ascending=True)
0.535

The rule 50/5 is present as the least 54 percent of missing teeth make up only for 5 percent of all missing teeth. We cumulate effect values from smallest to biggest by setting ascending to True.

By default we cumulate the other way around:

>>> mteeth.attain_effects(0.05)
0.004

We need only 0.4 percent of observations to attain 5 percent of total effects.

0.535/0.004 = 134 tells us the most powerful 5 percent of values have 134 times the power of the least 5 percent.

Which share of missing teeth do 50 percent of all young German adults make up?

>>> mteeth.attain_causes(1/2)
0.967

And the overview:

>>> mteeth.groups()
  Causes    Effects    Count    Mean    Stdev    Stdev/Mean    βˆ† Mean
--------  ---------  -------  ------  -------  ------------  --------
    100%       100%      966   2.069    3.441           1.7
     20%        67%      184   6.929    5.208           0.8     +235%
     80%        33%      782   0.926    1.174           1.3      -55%