D21684: Hypothesis test: Dock and View for t test and z test

Stefan Gerlach noreply at phabricator.kde.org
Mon Jun 10 11:42:36 BST 2019


sgerlach added inline comments.

INLINE COMMENTS

> HypothesisTest.cpp:252
> +
> +    if (test == TestT) {
> +        m_currTestName = i18n("Two Sample Independent T Test for %1 vs %2", m_columns[0]->name(), m_columns[1]->name());

maybe use switch here to handle all types of tests.

> HypothesisTest.cpp:334
> +    }
> +    else if (test == TestZ) {
> +        m_currTestName = i18n("Two Sample Independent Z Test for %1 vs %2", m_columns[0]->name(), m_columns[1]->name());

very similar to TestT. Put everything general for all tests outside the conditional blocks.

> HypothesisTest.h:64
>      void performTwoSampleTTest();
> +    void performTwoSampleIndependetTTest(bool equal_variance);
> +    void performTwoSamplePairedTTest();

Independe_n_t

> HypothesisTest.h:67
> +    void PerformOneSampleTTest();
> +    void performTwoSampleIndependetZTest();
> +    void performTwoSamplePairedZTest();

Independe_n_t

> HypothesisTestPrivate.h:42
>  
> +        enum Test {TestT, TestZ};
>          QString name() const;

enum TestType would be much clearer.

> HypothesisTestDock.cpp:94
> +
> +    ui.rb_h1_one_tail_1->setText( i18n("%1 %2 %3", mu, QChar(0x3E), mu0));
> +    ui.rb_h1_one_tail_2->setText( i18n("%1 %2 %3", mu, QChar(0x3C), mu0));

you can use  UTF8_QSTRING() to make special character more readable.

> HypothesisTestDock.cpp:282
>      QStringList cols;
> +    if(ttest) {
> +        if(two_sample_independent) {

shouldn't this be "test == ttest"? Using switch would make it more readable.

> HypothesisTestDock.cpp:283
> +    if(ttest) {
> +        if(two_sample_independent) {
> +            cols << ui.cbCol1->currentText() << ui.cbCol2->currentText();

using switch?

> HypothesisTestDock.cpp:301
> +    else if(ztest) {
> +        if(two_sample_independent) {
> +            cols << ui.cbCol1->currentText();

use switch?

> HypothesisTestDock.h:50
> +private slots:
> +        void on_rb_h1_one_tail_1_toggled(bool checked);
> +        void on_rb_h1_one_tail_2_toggled(bool checked);

function name convention is camelCase.

> HypothesisTestDock.h:51
> +        void on_rb_h1_one_tail_1_toggled(bool checked);
> +        void on_rb_h1_one_tail_2_toggled(bool checked);
> +        void on_rb_h1_two_tail_toggled(bool checked);

same here.

> HypothesisTestDock.h:52
> +        void on_rb_h1_one_tail_2_toggled(bool checked);
> +        void on_rb_h1_two_tail_toggled(bool checked);
> +

same here

REPOSITORY
  R262 LabPlot

REVISION DETAIL
  https://phabricator.kde.org/D21684

To: devanshuagarwal, sgerlach, asemke
Cc: kde-edu, #labplot, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20190610/4fe39f14/attachment-0001.html>


More information about the kde-edu mailing list