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