Source code for naginterfaces.library.examples.anova.icc_ex
#!/usr/bin/env python3
"``naginterface.library.anova.icc`` Python Example."
# NAG Copyright 2018-2019.
# pylint: disable=invalid-name
from naginterfaces.library import anova
[docs]def main():
"""
Example for :func:`naginterfaces.library.anova.icc`.
Intraclass correlation (ICC) for assessing rater reliability.
>>> main()
naginterfaces.library.anova.icc Python Example Results.
Interrater reliability for a one-factor design.
Intraclass Correlation : 0.17
Lower Limit for 95.0% CI : -0.13
Upper Limit for 95.0% CI : 0.72
F statistic : 1.79
Degrees of Freedom 1 : 5.0
Degrees of Freedom 2 : 18.0
p-value : 0.165
"""
print('naginterfaces.library.anova.icc Python Example Results.')
print('Interrater reliability for a one-factor design.')
# The model type:
mtype = 1
# The matrix of scores:
score = [
[
[9.00, 2.00, 5.00, 8.00],
[6.00, 1.00, 3.00, 2.00],
[8.00, 4.00, 6.00, 8.00],
[7.00, 1.00, 2.00, 6.00],
[10.0, 5.00, 6.00, 9.00],
[6.00, 2.00, 4.00, 7.00],
]
]
icc_res = anova.icc(mtype, score)
print('Intraclass Correlation : {:5.2f}'.format(icc_res.icc))
print('Lower Limit for 95.0% CI : {:5.2f}'.format(icc_res.lci))
print('Upper Limit for 95.0% CI : {:5.2f}'.format(icc_res.uci))
print('F statistic : {:5.2f}'.format(icc_res.fstat))
print('Degrees of Freedom 1 : {:5.1f}'.format(icc_res.df1))
print('Degrees of Freedom 2 : {:5.1f}'.format(icc_res.df2))
print('p-value : {:5.3f}'.format(icc_res.pvalue))
if __name__ == '__main__':
import doctest
import sys
sys.exit(
doctest.testmod(
None, verbose=True, report=False,
optionflags=doctest.REPORT_NDIFF,
).failed
)