| 1 | #ifndef _ContingencyTable_h_ |
| 2 | #define _ContingencyTable_h_ |
| 3 | /* ContingencyTable.h |
| 4 | * |
| 5 | * Copyright (C) 1993-2018 David Weenink |
| 6 | * |
| 7 | * This code is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or (at |
| 10 | * your option) any later version. |
| 11 | * |
| 12 | * This code is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #include "TableOfReal.h" |
| 22 | #include "Confusion.h" |
| 23 | |
| 24 | Thing_define (ContingencyTable, TableOfReal) { |
| 25 | void v1_info () |
| 26 | override; |
| 27 | }; |
| 28 | |
| 29 | // Precondition: All entries in a ContingencyTable are nonnegative numbers |
| 30 | |
| 31 | autoContingencyTable ContingencyTable_create (integer numberOfRows, integer numberOfColumns); |
| 32 | |
| 33 | double ContingencyTable_chisqProbability (ContingencyTable me); |
| 34 | |
| 35 | double ContingencyTable_cramersStatistic (ContingencyTable me); |
| 36 | |
| 37 | double ContingencyTable_contingencyCoefficient (ContingencyTable me); |
| 38 | |
| 39 | void ContingencyTable_chisq (ContingencyTable me, double *out_chisq, double *out_df); |
| 40 | |
| 41 | void ContingencyTable_getEntropies (ContingencyTable me, double *out_h, double *out_hx, double *out_hy, double *out_hygx, double *out_hxgy, double *out_uygx, double *out_uxgy, double *out_uxy); |
| 42 | |
| 43 | autoContingencyTable Confusion_to_ContingencyTable (Confusion me); |
| 44 | |
| 45 | autoContingencyTable TableOfReal_to_ContingencyTable (TableOfReal me); |
| 46 | |
| 47 | #endif // _ContingencyTable_h_ |