D21857: Levene Test Implementaion

Stefan Gerlach noreply at phabricator.kde.org
Tue Jun 18 21:33:16 BST 2019


sgerlach added inline comments.

INLINE COMMENTS

> HypothesisTest.cpp:232
> +            }case ErrorEmptyColumn: {
>                  printError("At least one of selected column is empty");
>                  emit q->changed();

please translate all user visible messages

> HypothesisTest.cpp:239
> +
> +        QMapIterator<QString, int> i(col_name);
> +        while (i.hasNext()) {

better use "iter" or "nameIter". "i" should be only for counting integer.

> HypothesisTest.cpp:470
> +    int total_rows = 0;
> +    clearGlobalVariables();
> +

Do you really use global vars? Please avoid this and make this function  obsolete.

> HypothesisTest.cpp:473
> +    if (m_columns.size() != 2) {
> +        printError("Inappropriate number of columns selected");
> +        emit q->changed();

translate

> HypothesisTest.cpp:484
> +    if (np < 2) {
> +        printError("select atleast two columns/ classes");
> +        emit q->changed();

at least + translate

> HypothesisTest.cpp:525
> +            if (ni[i] > 0)
> +                yi_bar[i] = yi_bar[i] / ni[i];
> +        }

use "/="

> HypothesisTest.cpp:532
> +                if (!(std::isnan(value)))
> +                    zi_bar[i] += abs(value - yi_bar[i]);
> +            }

fabs() ?

> HypothesisTest.cpp:614
> +            zi_bar_bar += zi_bar[i];
> +            zi_bar[i] = zi_bar[i] / ni[i];
> +        }

"/="

> HypothesisTest.cpp:617
> +
> +        zi_bar_bar = zi_bar_bar / n;
> +

"/="

> HypothesisTest.cpp:670
> +
> +    printLine(0, "Null Hypothesis: Variance is equal between all classes", "blue");
> +    printLine(1, "Alternate Hypothesis: Variance is not equal in at-least one pair of classes", "blue");

translation (2x)

> HypothesisTest.cpp:679
> +        q->m_view->setResultLine(5, i18n("We can safely reject Null Hypothesis for significance level %1", m_significance_level), Qt::ToolTipRole);
> +        printLine(8, "Requirement for homogeneity is not met", "red");
> +    } else {

translation

> HypothesisTest.cpp:682
> +        q->m_view->setResultLine(5, i18n("There is a plausibility for Null Hypothesis to be true"), Qt::ToolTipRole);
> +        printLine(8, "Requirement for homogeneity is met", "green");
> +    }

translation

> HypothesisTest.cpp:764
>  
> -HypothesisTestPrivate::ErrorType HypothesisTestPrivate::findStatsCategorical(const Column *column1, const Column *column2, int n[], double sum[], double mean[], double std[], QString &col1_name, QString &col2_name) {
> -    // clearing and initialising variables;
> +void HypothesisTestPrivate::countPartitions(Column *column, int &np, int &total_rows) {
> +    total_rows = column->rowCount();

Column* column

> HypothesisTest.h:67
>  
> -    void performTwoSampleTTest();
> -    void performTwoSampleIndependentTTest(bool equal_variance);
> +    void performTwoSampleIndependentTTest(bool categorical_variable, bool equal_variance);
>      void performTwoSamplePairedTTest();

can you use camelCase for all variables? Just to make the naming style more consistent. I should have mentioned that before...

> HypothesisTestPrivate.h:42
>  
>          enum TestType {TestT, TestZ};
> +        enum ErrorType {ErrorUnqualSize, ErrorEmptyColumn, NoError};

better "HypothesisTestType"?

> HypothesisTestPrivate.h:43
>          enum TestType {TestT, TestZ};
> -        enum ErrorType {ErrorUnqualSize, ErrorNotTwoCategoricalVariables, ErrorEmptyColumn, NoError};
> +        enum ErrorType {ErrorUnqualSize, ErrorEmptyColumn, NoError};
>  

better "HypothesisErrorType"?

REPOSITORY
  R262 LabPlot

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

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/20190618/d9414e65/attachment-0001.html>


More information about the kde-edu mailing list