cleverly.sensitivity.TimeBalanceRow#
- class cleverly.sensitivity.TimeBalanceRow(diagnostic: str, exposure: str, exposure_node: int, exposure_time: float, covariate: str, covariate_node: int, distance: int, history: str, contrast: str, levels: str, n_units: int, mean_group: float, mean_rest: float, mean_group_weighted: float, mean_rest_weighted: float, spread: float, difference_unweighted: float, difference_weighted: float, smd_unweighted: float, smd_weighted: float, person_time_unweighted: float, person_time_weighted: float)[source]#
One covariate in one comparison of one diagnostic, within one stratum.
- Parameters:
- diagnostic{“confounding”, “feedback”, “censoring”, “joint”}
Which check the row belongs to (see
BalanceOverTime).- exposure
str What the groups differ by: a treatment column,
"censoring at <time>","eliminated causes at <time>", or"status known at <time>".- exposure_node
int The time point of the exposure, counted from one; for the rows read at a target time of a continuous-time fit, the target time’s position counted from one.
- exposure_time
float The exposure’s time: the grid time of a node when the data has one, the target time of a continuous-time row, else
exposure_node.0.0for a baseline treatment of a continuous-time fit.- covariate
str The covariate’s column.
- covariate_node
int The time point the covariate was measured at;
0for a baseline covariate.- distance
int How many time points separate the covariate from the exposure.
- history
str The earlier treatments the stratum shares, such as
"A1 = 1, A2 = 0"; empty when there are none.- contrast
str The two groups compared, in words.
- levels
str The two groups, without the node:
"1 vs 0", which matches rows over time.- n_units
int The rows in the two groups.
- mean_group
float The covariate’s mean in the first group, with the data’s weights only.
- mean_rest
float Its mean in the other group, with the data’s weights only.
- mean_group_weighted
float The first group’s mean under the diagnostic’s weights.
- mean_rest_weighted
float The other group’s mean under those weights.
- spread
float The standard deviation both differences are divided by: the pooled standard deviation of the two groups in the stratum, before the diagnostic’s weights.
nanwhen it is zero or a group has fewer than two rows.- difference_unweighted
float mean_group - mean_rest.- difference_weighted
float mean_group_weighted - mean_rest_weighted.- smd_unweighted
float The unweighted difference divided by
spread.- smd_weighted
float The weighted difference divided by
spread.- person_time_unweighted
float The stratum’s size with the data’s weights, which the averages weight the unweighted column by.
- person_time_weighted
float The stratum’s size under the stabilized weights, which the averages weight the weighted column by.