Skip to content

hbsir.calculate.quantile

Calculates weighted quantiles for the given column.

Parameters:

Name Type Description Default
table DataFrame | Series

Table containing column to calculate quantiles for.

None
on_variable _QuantileBase

Variable to calculate quantiles on.

None
on_column str

Column name to calculate quantiles on.

None
bins int

Number of quantile bins to create.

-1

Other Parameters:

Name Type Description
quantile_column_name str

Name for added quantile column.

weight_column str

Column name to use for weighting rows.

weighted bool

Whether to calculate weighted quantiles.

adjust_weight_for_household_size bool

Adjust weights for household size.

equivalence_scale _EquivalenceScale

Household equivalence scale to use.

for_all bool

Calculate quantiles across all rows.

annual bool

Annualize quantiles.

groupby str | list[str]

Column(s) to group by.

years list[int]

Years to include.

Returns:

Type Description
Series

Series with quantiles for each row.