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.

dataarray_like, 2-Dim

data containing category assignment with subjects in rows and raters in columns.

n_catNone or int

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.

arrnd_array, (n_rows, n_cat)

Contains counts of raters that assigned a category level to individuals. Subjects are in rows, category levels in columns.