face2face.statistics.null_modell.check_bonferroni_correction

face2face.statistics.null_modell.check_bonferroni_correction(contact_matrix)

Apply the bonferroni correction on the contact matrix

Calculates the p_values of the contact matrix and applies the bonferroni correction on the contact matrix

Parameters

contact_matrix (list) – A matrixlike List of lists that contains the z-scores for a given attribute.

Returns

annotation_list – A matrixlike list of lists that contains the annotated z-scores for a given attribute. They are annotated with a * if they are too small in terms of the bonferroni correction.

Return type

list

Notes

The annotation_list contains the z-scores of the contact matrix and adds a * at every z-score that is an outlier

References

1

Génois, Mathieu & Zens, Maria & Lechner, Clemens & Rammstedt, Beatrice & Strohmaier, Markus. (2019). Building connections: How scientists meet each other during a conference.

Examples

>>> cm = np.array([[1, 1, 3.4], [1, 1, 1], [3.4, 1, 1]])
>>> annotated_cm = check_bonferroni_correction(cm)
>>> print(annotated_cm)
[['1.0', '1.0', '3.4*'], ['1.0', '1.0', '1.0'], ['3.4*', '1.0', '1.0']]