QtiPlot
0.9.8.2
|
00001 /*************************************************************************** 00002 File : StatisticTest.h 00003 Project : QtiPlot 00004 -------------------------------------------------------------------- 00005 Copyright : (C) 2010 by Ion Vasilief 00006 Email (use @ for *) : ion_vasilief*yahoo.fr 00007 Description : Base class for statistic tests 00008 00009 ***************************************************************************/ 00010 00011 /*************************************************************************** 00012 * * 00013 * This program is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU General Public License as published by * 00015 * the Free Software Foundation; either version 2 of the License, or * 00016 * (at your option) any later version. * 00017 * * 00018 * This program is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00021 * GNU General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU General Public License * 00024 * along with this program; if not, write to the Free Software * 00025 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 00026 * Boston, MA 02110-1301 USA * 00027 * * 00028 ***************************************************************************/ 00029 #ifndef STATISTICTEST_H 00030 #define STATISTICTEST_H 00031 00032 #include <Statistics.h> 00033 00034 class Table; 00035 00037 class StatisticTest : public Statistics 00038 { 00039 Q_OBJECT 00040 00041 public: 00042 enum Tail{Left = 0, Right = 1, Both = 2}; 00043 enum TestType{StudentTest = 0, NormalityTest = 1, ChiSquareTest = 2, AnovaTest = 3}; 00044 00045 StatisticTest(ApplicationWindow *parent, double testValue = 0.0, double level = 0.05, const QString& sample = QString()); 00046 void setTail(const Tail& tail){d_tail = tail;}; 00047 void setTestValue(double val){d_test_val = val;}; 00048 void showDescriptiveStatistics(bool show = true){d_descriptive_statistics = show;}; 00049 00050 void setSignificanceLevel(double s){ 00051 if (s < 0.0 || s > 1.0) 00052 return; 00053 d_significance_level = s; 00054 } 00055 00056 virtual QString logInfo(){return Statistics::logInfo();}; 00057 virtual double statistic(){return 0.0;}; 00058 virtual double pValue(){return 0.0;}; 00060 virtual double lcl(double){return 0.0;}; 00062 virtual double ucl(double){return 0.0;}; 00063 00065 virtual Table *resultTable(const QString& name = QString()); 00066 virtual void outputResultsTo(Table *); 00067 00068 protected: 00069 double d_test_val; 00070 double d_significance_level; 00071 int d_tail; 00072 bool d_descriptive_statistics; 00073 }; 00074 00075 #endif