This module contains functions to compute intraclass correlation coefficient (ICC)
models[1][2].
Those functions allow to compute single score or average score ICCs as an index of
inter-rater reliability of quantitative data. Additionally, F-test and confidence
interval are computed.
When considering which form of ICC is appropriate for an actual set of data one has take
several decisions (Shrout & Fleiss, 1979)[3]:
1. Should only the subjects be considered as random effects
(ICCModel.ONE_WAY) or are subjects and raters randomly chosen from a bigger
pool of persons (ICCModel.TWO_WAY).
3. If the unit of analysis is a mean of several ratings, unit should be changed to
ICCUnit.AVERAGE. In most cases, however, single values
(ICCUnit.SINGLE) are regarded.
This transformation ensures that sessions have sufficient support, i.e. a subject is
only considered if it has contributed more than session_min sessions. A session
is dropped if it has a higher null ratio than null_ratio.
Parameters:
data (DataFrame) – A data frame with subjects as rows, sessions as columns, and cells containing
the measure values.
session_min (int) – The minimum number of required sessions for each subject to be considered in the
analysis.
null_ratio (float) – The ratio of null values across subjects for a particular session below which it
is taken into account.
Returns:
The filtered data containing only subjects that have contributed at least
session_min sessions, sessions that have a lower ratio of null values than
null_ratio, and subjects that have no null value for the latter sessions.
Compute the icc score from parallel form measures.
This score allows the comparison of to measures of same nature and definition but
obtained in different condition (example : CPS mean RT on predefinedKey1 compared to
predefinedKey2)
Parameters:
form1 (pandas.DataFrame) – A data frame containing the M measure form 1 values for all users
form2 (pandas.DataFrame) – A data frame containing the M’ measure form 2 values for all users
Returns:
The parallel form ICC score containing the value with its definition and its 95%
confidence interval
Compute the ICC test retest score for all measures.
It takes into consideration the study type, which could be either “control” or
“clinical”. It also ensures sessions have sufficient support. See
icc_test_retest_session_safe() for details.
errors (Literal['raise', 'ignore']) – How to handle errors occurring during the computation of ICC scores.
- If ‘raise’, then errors will be risen.
- If ‘ignore’, then the measure will be skipped.