Skip to content

Commit

Permalink
fix reversed polarity in computeSignificance (#126)
Browse files Browse the repository at this point in the history
Molly (and ten modelers) noticed that the signifiance polarity was
backwards on the GUI for everything except bias - durring a demo.
  • Loading branch information
randytpierce authored Jan 24, 2024
2 parents 6fa5ba9 + 29e53fe commit 51ed4f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions pkg/builder/TestTwoSampleTTestBuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func TestTwoSampleTTestBuilder_test_neagtive_2(t *testing.T) {
if err != nil {
t.Fatal(fmt.Sprint("TestTwoSampleTTestBuilder_test_2 - computeSignificance - error message : ", err))
}
if cellPtr.value != -2 {
if cellPtr.value != 2 {
t.Fatal("test_2_wrong value :", cellPtr.value)
}
}
Expand Down Expand Up @@ -224,7 +224,7 @@ func TestTwoSampleTTestBuilder_test_1(t *testing.T) {
t.Fatal(fmt.Sprint("TestTwoSampleTTestBuilder_test_1 - computeSignificance - error message : ", err))
}
fmt.Println("Pval is", cellPtr.pvalue, "value is ", cellPtr.value)
if cellPtr.value != 2 {
if cellPtr.value != -2 {
t.Fatal("test_1 wrong value :", cellPtr.value)
}
}
Expand Down Expand Up @@ -281,7 +281,7 @@ func TestTwoSampleTTestBuilder_test_0(t *testing.T) {
t.Fatal(fmt.Sprint("TestTwoSampleTTestBuilder_test_0 - computeSignificance - error message : ", err))
}
fmt.Println("Pval is", cellPtr.pvalue, "value is ", cellPtr.value)
if cellPtr.value != -2 {
if cellPtr.value != 2 {
t.Fatal("test_0 wrong value :", cellPtr.value)
}
}
Expand Down Expand Up @@ -389,7 +389,7 @@ func TestTwoSampleTTestBuilder_test__match_ctl_short_1(t *testing.T) {
t.Fatal(fmt.Sprint("TestTwoSampleTTestBuilder_test_1 - computeSignificance - error message : ", err))
}
fmt.Println("Pval is", cellPtr.pvalue, "value is ", cellPtr.value)
if cellPtr.value != 2 {
if cellPtr.value != -2 {
t.Fatal("test_1 wrong value :", cellPtr.value)
}
}
Expand Down Expand Up @@ -448,7 +448,7 @@ func TestTwoSampleTTestBuilder_test__match_exp_short_1(t *testing.T) {
t.Fatal(fmt.Sprint("TestTwoSampleTTestBuilder_test_1 - computeSignificance - error message : ", err))
}
fmt.Println("Pval is", cellPtr.pvalue, "value is ", cellPtr.value)
if cellPtr.value != 2 {
if cellPtr.value != -2 {
t.Fatal("test_1 wrong value :", cellPtr.value)
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/builder/TwoSampleTTestBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func (scc *ScorecardCell) computeSignificance() error {
if scc.statisticType == Bias_Model_Obs {
difference = (math.Abs(meanCtl) - math.Abs(meanExp))
} else {
difference = (meanExp - meanCtl)
difference = (meanCtl - meanExp)
}
scc.pvalue = ret.P
v, err := scc.deriveValue(difference, ret.P)
Expand Down

0 comments on commit 51ed4f2

Please sign in to comment.