statsmodels.stats.inter_rater.aggregate_raters#
- statsmodels.stats.inter_rater.aggregate_raters(data, n_cat=None)[source]#
Convert raw data with shape (subject, rater) to (subject, cat_counts)
Brings data into correct format for fleiss_kappa.
bincount will raise exception if data cannot be converted to integer.
- Parameters:
- dataarray_like, 2-Dim
Data containing category assignment with subjects in rows and raters in columns.
- n_cat
Noneorint If None, then the data is converted to integer categories, 0,1,2,…,n_cat-1. Because of the relabeling only category levels with non-zero counts are included. If this is an integer, then the category levels in the data are already assumed to be in integers, 0,1,2,…,n_cat-1. In this case, the returned array may contain columns with zero count, if no subject has been categorized with this level.
- Returns: