cleverly.sensitivity.BalanceRow#

class cleverly.sensitivity.BalanceRow(contrast: str, covariate: str, mean_group: float, mean_rest: float, mean_group_weighted: float, mean_rest_weighted: float, spread: float, smd_unweighted: float, smd_weighted: float)[source]#

One covariate in one contrast.

Parameters:
contraststr

The two groups compared, in words.

covariatestr

The covariate; one level of a categorical covariate has its own row, named "column = level".

mean_groupfloat

The covariate’s mean in the first group, with the data’s weights only.

mean_restfloat

Its mean in the other group, with the data’s weights only.

mean_group_weightedfloat

The first group’s mean under the fit’s weights.

mean_rest_weightedfloat

The other group’s mean under those weights.

spreadfloat

The standard deviation both differences are divided by, computed before weighting by the propensity (see CovariateBalance.estimand). nan for a covariate with no spread.

smd_unweightedfloat

The standardized mean difference before weighting.

smd_weightedfloat

The standardized mean difference after weighting.

Methods#

Attributes#

BalanceRow.contrast: str#
BalanceRow.covariate: str#
BalanceRow.mean_group: float#
BalanceRow.mean_rest: float#
BalanceRow.mean_group_weighted: float#
BalanceRow.mean_rest_weighted: float#
BalanceRow.spread: float#
BalanceRow.smd_unweighted: float#
BalanceRow.smd_weighted: float#