bpp-core3
3.0.0
|
Implements tests on contingency tables. More...
#include <Bpp/Numeric/Stat/ContingencyTableTest.h>
Public Member Functions | |
ContingencyTableTest (const std::vector< std::vector< size_t >> &table, unsigned int nbPermutations=0, bool warn=true) | |
Build a new test object and perform computations. More... | |
virtual | ~ContingencyTableTest () |
ContingencyTableTest * | clone () const |
Create a copy of this object and send a pointer to it. More... | |
std::string | getName () const |
double | getStatistic () const |
double | getPValue () const |
double | getDegreesOfFreedom () const |
const std::vector< size_t > | getMarginRows () const |
const std::vector< size_t > | getMarginColumns () const |
Private Attributes | |
double | statistic_ |
double | pvalue_ |
double | df_ |
std::vector< size_t > | margin1_ |
std::vector< size_t > | margin2_ |
Implements tests on contingency tables.
Performs a chi square test on contingency tables.
Definition at line 21 of file ContingencyTableTest.h.
ContingencyTableTest::ContingencyTableTest | ( | const std::vector< std::vector< size_t >> & | table, |
unsigned int | nbPermutations = 0 , |
||
bool | warn = true |
||
) |
Build a new test object and perform computations.
table | The input contingency table. |
nbPermutations | If greater than 0, performs a randomization test instead of using the chisquare approximation. |
warn | Should a warning message be displayed in case of unsufficient observations? |
Definition at line 17 of file ContingencyTableTest.cpp.
References bpp::TextTools::count(), df_, bpp::ApplicationTools::displayWarning(), margin1_, margin2_, bpp::RandomTools::pChisq(), pvalue_, bpp::ContingencyTableGenerator::rcont2(), statistic_, bpp::VectorTools::sum(), and bpp::TextTools::toString().
Referenced by clone().
|
inlinevirtual |
Definition at line 40 of file ContingencyTableTest.h.
|
inlinevirtual |
Create a copy of this object and send a pointer to it.
Implements bpp::Clonable.
Definition at line 42 of file ContingencyTableTest.h.
References ContingencyTableTest().
|
inline |
Definition at line 48 of file ContingencyTableTest.h.
References df_.
|
inline |
Definition at line 50 of file ContingencyTableTest.h.
References margin2_.
|
inline |
Definition at line 49 of file ContingencyTableTest.h.
References margin1_.
|
inlinevirtual |
Implements bpp::StatTest.
Definition at line 45 of file ContingencyTableTest.h.
|
inlinevirtual |
|
inlinevirtual |
Implements bpp::StatTest.
Definition at line 46 of file ContingencyTableTest.h.
References statistic_.
|
private |
Definition at line 27 of file ContingencyTableTest.h.
Referenced by ContingencyTableTest(), and getDegreesOfFreedom().
|
private |
Definition at line 28 of file ContingencyTableTest.h.
Referenced by ContingencyTableTest(), and getMarginRows().
|
private |
Definition at line 29 of file ContingencyTableTest.h.
Referenced by ContingencyTableTest(), and getMarginColumns().
|
private |
Definition at line 26 of file ContingencyTableTest.h.
Referenced by ContingencyTableTest(), and getPValue().
|
private |
Definition at line 25 of file ContingencyTableTest.h.
Referenced by ContingencyTableTest(), and getStatistic().