QtiPlot  0.9.8.2
Anova.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : Anova.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2010 by Ion Vasilief
6  Email (use @ for *) : ion_vasilief*yahoo.fr
7  Description : ANOVA
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 #ifndef Anova_H
30 #define Anova_H
31 
32 #include <StatisticTest.h>
33 #include <tamu_anova.h>
34 
36 class Anova : public StatisticTest
37 {
38  Q_OBJECT
39 
40  public:
41  Anova(ApplicationWindow *parent, bool twoWay = false, double level = 0.05);
42 
43  void showAnovaTwoWayInteractions(bool show = true){d_show_interactions = show;};
44  void setAnovaTwoWayModel(int type){d_anova_type = (gsl_anova_twoway_types)type;};
45  bool addSample(const QString& colName, int aLevel = 1, int bLevel = 1);
46  bool run();
47 
48  virtual QString logInfo();
49 
51 
52  double fStat(){return d_at.F;};
53  double statistic(){return d_at.F;};
54  double pValue(){return d_at.p;};
55  double ssm(){return d_at.SSTr;};
57 
59 
60  double fStatA(){return d_att.FA;};
61  double fStatB(){return d_att.FB;};
62  double fStatAB(){return d_att.FAB;};
63 
64  double pValueA(){return d_att.pA;};
65  double pValueB(){return d_att.pB;};
66  double pValueAB(){return d_att.pAB;};
67 
68  double ssa(){return d_att.SSA;};
69  double ssb(){return d_att.SSB;};
70  double ssab(){return d_att.SSAB;};
71 
72  double msa(){return d_att.MSA;};
73  double msb(){return d_att.MSB;};
74  double msab(){return d_att.MSAB;};
76 
77  double sse(){if (d_two_way) return d_att.SSE; return d_at.SSE;};
78  double sst(){if (d_two_way) return d_att.SST; return d_at.SST;};
79  double mse(){if (d_two_way) return d_att.MSE; return d_at.MSE;};
80 
82  virtual Table *resultTable(const QString& name = QString());
83  virtual void outputResultsTo(Table *);
84 
85  protected:
86  bool twoWayANOVA();
87  bool oneWayANOVA();
88  void freeMemory();
89  QString levelName(int level, bool b = false);
90 
91  bool d_two_way;
93  gsl_anova_twoway_types d_anova_type;
94  QList<Statistics *> d_data_samples;
95  QList<int> d_factorA_levels;
96  QList<int> d_factorB_levels;
97 
98  tamu_anova_table d_at;
99  tamu_anova_table_twoway d_att;
100 };
101 
102 #endif
bool twoWayANOVA()
Definition: Anova.cpp:92
void setAnovaTwoWayModel(int type)
Definition: Anova.h:44
double fStat()
Definition: Anova.h:52
QList< int > d_factorA_levels
Definition: Anova.h:95
double pValueAB()
Definition: Anova.h:66
QString levelName(int level, bool b=false)
Definition: Anova.cpp:220
virtual Table * resultTable(const QString &name=QString())
Returns a pointer to the table created to display the results.
Definition: Anova.cpp:392
bool d_show_interactions
Definition: Anova.h:92
bool d_two_way
Definition: Anova.h:91
double sse()
Definition: Anova.h:77
double fStatB()
Definition: Anova.h:61
double sst()
Definition: Anova.h:78
virtual QString logInfo()
Definition: Anova.cpp:228
double mse()
Definition: Anova.h:79
double ssab()
Definition: Anova.h:70
QList< Statistics * > d_data_samples
Definition: Anova.h:94
Anova(ApplicationWindow *parent, bool twoWay=false, double level=0.05)
Definition: Anova.cpp:34
QList< int > d_factorB_levels
Definition: Anova.h:96
double ssb()
Definition: Anova.h:69
tamu_anova_table d_at
Definition: Anova.h:98
virtual void outputResultsTo(Table *)
Definition: Anova.cpp:316
QtiPlot's main window.
Definition: ApplicationWindow.h:133
double ssm()
Definition: Anova.h:55
bool oneWayANOVA()
Definition: Anova.cpp:181
double msab()
Definition: Anova.h:74
double pValueA()
Definition: Anova.h:64
gsl_anova_twoway_types d_anova_type
Definition: Anova.h:93
tamu_anova_table_twoway d_att
Definition: Anova.h:99
double pValue()
Definition: Anova.h:54
bool addSample(const QString &colName, int aLevel=1, int bLevel=1)
Definition: Anova.cpp:43
double ssa()
Definition: Anova.h:68
void freeMemory()
Frees the memory allocated for the X and Y data sets.
Definition: Anova.cpp:464
double msb()
Definition: Anova.h:73
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:57
double pValueB()
Definition: Anova.h:65
Abstract base class for statistic tests.
Definition: StatisticTest.h:37
double statistic()
Definition: Anova.h:53
double msa()
Definition: Anova.h:72
double fStatA()
Definition: Anova.h:60
bool run()
Actually does the job. Should be reimplemented in derived classes.
Definition: Anova.cpp:67
void showAnovaTwoWayInteractions(bool show=true)
Definition: Anova.h:43
ANOVA.
Definition: Anova.h:36
double fStatAB()
Definition: Anova.h:62