mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 12:07:09 +00:00
fix(analyze): write an undefined paired p-value as null, not as NaN
A paired contrast where censoring orders no pair has no p-value, and JSON has no NaN, so --json failed with 'marshal summary: json: unsupported value: NaN' and wrote no summary at all after printing a complete report. The two fields join the medians and the rates already carried as pointers, undefined reading as null in the summary and n/a in the report. Reachable since a clean run started being censored where it stopped: an arm the wall clock stops before its partner ever violates orders nothing.
This commit is contained in:
1 parent
8fad1937bb
commit
4bcd82a8a6
6 files changed
+60
-23
No files matched your search
@@ -105,8 +105,9 @@ func analysePaired(arms []arm, now time.Time) (analysis, error) {
|
||||
return analysis{}, fmt.Errorf("arms %q and %q share no seed with a usable run in both",
|
||||
testable[0].Name, testable[1].Name)
|
||||
}
|
||||
if !math.IsNaN(comparison.PValue) {
|
||||
comparison.HolmPValue = holm([]float64{comparison.PValue})[0]
|
||||
if comparison.PValue != nil {
|
||||
adjusted := holm([]float64{*comparison.PValue})[0]
|
||||
comparison.HolmPValue = &adjusted
|
||||
result.HolmFamilySize = 1
|
||||
}
|
||||
result.Paired = &comparison
|
||||
|
||||
Reference in new issue
Block a user