fedeca.metrics¶
Define metrics for ECA analysis.
- standardized_mean_diff(confounders, treated, weights=None, use_unweighted_variance=True)¶
Compute the Standardized Mean Differences (SMD).
Compute the Standardized Mean Differences between treated and control patients.
- Parameters:
confounders (
pd.DataFrame
) – confounders array.treated (
np.ndarray
) – mask of booleans giving information about treated patients.weights (
np.ndarray
) – weights for the aggregationuse_unweighted_variance (
bool
) – if True, the variance is computed without weights. To follow https://stats.stackexchange.com/questions/618643/formula-for-standardized-mean-difference-in-cobalt-package-for-categorical-varia # noqa: E501 If False use recalibrated variance as in https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4626409/. # noqa: E501
- Returns:
smd – standardized mean differences of the confounders.
- Return type:
np.ndarray