1 /***************************************************************************
2 	File                 : StudentTestDialog.h
3     Project              : QtiPlot
4     --------------------------------------------------------------------
5 	Copyright            : (C) 2010 by Ion Vasilief
6     Email (use @ for *)  : ion_vasilief*yahoo.fr
7 	Description          : Student's t-Test dialog
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 StudentTestDialog_H
30 #define StudentTestDialog_H
31 
32 #include <QDialog>
33 #include <StatisticTest.h>
34 
35 class QGroupBox;
36 class QComboBox;
37 class QCheckBox;
38 class QLabel;
39 class QLineEdit;
40 class QPushButton;
41 class QRadioButton;
42 class QSpinBox;
43 class DoubleSpinBox;
44 class Table;
45 class Note;
46 class CollapsiveGroupBox;
47 
48 //! Filter options dialog
49 class StudentTestDialog : public QDialog
50 {
51     Q_OBJECT
52 
53 public:
54 	StudentTestDialog(const StatisticTest::TestType& type, Table *t, bool twoSamples = false, QWidget* parent = 0);
55 
56 private slots:
57     void accept();
58 	void updateMeanLabels(double);
59 	void updateMeanLabel();
60 	void addConfidenceLevel();
61 	void enableDescriptiveStatistics();
62 
63 private:
64 	void closeEvent(QCloseEvent*);
65 	void acceptStudentTest();
66 	void acceptChiSquareTest();
67 	void outputResults(StatisticTest* stats, const QString& s);
68 
69 	StatisticTest::TestType d_test_type;
70 	bool d_two_samples;
71 
72 	QComboBox *boxSample1;
73 	QComboBox *boxSample2;
74 	QRadioButton *bothTailButton;
75 	QRadioButton *leftTailButton;
76 	QRadioButton *rightTailButton;
77 	QLabel *meanLabel;
78 	QLabel *bothTailLabel;
79 	QLabel *leftTailLabel;
80 	QLabel *rightTailLabel;
81 	CollapsiveGroupBox *boxConfidenceInterval;
82 	QPushButton* buttonAddLevel;
83 	QPushButton* buttonOk;
84 	CollapsiveGroupBox *boxPowerAnalysis;
85 	QSpinBox *boxSampleSize;
86 	QCheckBox *boxOtherSampleSize;
87 	DoubleSpinBox* boxMean;
88 	DoubleSpinBox* boxSignificance;
89 	DoubleSpinBox* boxPowerLevel;
90 
91 	QRadioButton *independentTestBtn;
92 	QRadioButton *pairedTestBtn;
93 
94 	CollapsiveGroupBox *outputSettingsBox;
95 	QCheckBox *boxResultsTable;
96 	QLineEdit *tableNameLineEdit;
97 	QCheckBox *boxResultsLog;
98 	QCheckBox *boxNoteWindow;
99 	QLineEdit *noteNameLineEdit;
100 	QCheckBox *showStatisticsBox;
101 
102 	Table *d_table;
103 	Note *d_note;
104 };
105 
106 #endif
107