Statistics.h
Go to the documentation of this file.
/***************************************************************************
File : Statistics.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2010 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr
Description : Abstract base class for statistics data analysis
***************************************************************************/
/***************************************************************************
* *
* 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 STATISTICS_H
#define STATISTICS_H
#include <QObject>
#include <ApplicationWindow.h>
class Table;
class Statistics : public QObject
{
Q_OBJECT
public:
Statistics(ApplicationWindow *parent, const QString& name = QString());
~Statistics();
virtual bool run();
bool setData(const QString&);
void showResultsLog(bool show = true){d_result_log = show;};
QString sampleName(){return d_col_name;};
unsigned int dataSize(){return d_n;};
virtual int dof(){return d_n - 1;};
double* data(){return d_data;};
double mean(){return d_mean;};
double variance(){return d_variance;};
double standardDeviation(){return d_sd;};
double standardError(){return d_se;};
QString logInfo(bool header = true);
protected:
void memoryErrorMessage();
virtual void freeMemory();
QString d_col_name;
bool d_result_log;
unsigned int d_n;
double *d_data;
Table *d_table;
double d_mean;
double d_sd;
double d_variance;
double d_se;
};
#endif
Statistics::data
double * data()
Returns the y values of the input data set.
Definition: Statistics.h:59
Statistics::d_table
Table * d_table
A table source of data.
Definition: Statistics.h:82
Statistics::~Statistics
~Statistics()
Definition: Statistics.cpp:191
Statistics::mean
double mean()
Definition: Statistics.h:61
Statistics
Abstract base class for data analysis operations.
Definition: Statistics.h:38
Statistics::standardError
double standardError()
Definition: Statistics.h:64
Statistics::d_variance
double d_variance
Definition: Statistics.h:86
Statistics::Statistics
Statistics(ApplicationWindow *parent, const QString &name=QString())
Definition: Statistics.cpp:38
Statistics::d_se
double d_se
Definition: Statistics.h:87
Statistics::logInfo
QString logInfo(bool header=true)
Definition: Statistics.cpp:120
ApplicationWindow
QtiPlot's main window.
Definition: ApplicationWindow.h:133
Statistics::d_col_name
QString d_col_name
The name of the source data set.
Definition: Statistics.h:74
Statistics::sampleName
QString sampleName()
Definition: Statistics.h:51
Statistics::d_n
unsigned int d_n
The size of the data set to be analyzed.
Definition: Statistics.h:78
Statistics::d_data
double * d_data
y data set to be analysed
Definition: Statistics.h:80
Statistics::d_mean
double d_mean
Definition: Statistics.h:84
Statistics::standardDeviation
double standardDeviation()
Definition: Statistics.h:63
Statistics::dof
virtual int dof()
Returns the degrees of freedom.
Definition: Statistics.h:56
Statistics::freeMemory
virtual void freeMemory()
Frees the memory allocated for the X and Y data sets.
Definition: Statistics.cpp:182
Table
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:57
Statistics::setData
bool setData(const QString &)
Definition: Statistics.cpp:64
ApplicationWindow.h
Statistics::memoryErrorMessage
void memoryErrorMessage()
Definition: Statistics.cpp:174
Statistics::d_result_log
bool d_result_log
Flag specifying if the results should be displayed in the results log.
Definition: Statistics.h:76
Statistics::dataSize
unsigned int dataSize()
Returns the size of the input data set.
Definition: Statistics.h:54
Statistics::variance
double variance()
Definition: Statistics.h:62
Statistics::d_sd
double d_sd
Definition: Statistics.h:85
Statistics::showResultsLog
void showResultsLog(bool show=true)
Definition: Statistics.h:49
Statistics::run
virtual bool run()
Actually does the job. Should be reimplemented in derived classes.
Definition: Statistics.cpp:49