From 55dbd067e476f4e1ff6dfec068506b3794e3ea67 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Mon, 7 Oct 2024 18:03:34 +0000 Subject: [PATCH] Per #2883, need to call set_n_pairs() in a few spots to set ECLV TOTAL column correctly ci-run-unit --- src/libcode/vx_statistics/contable.cc | 2 ++ src/libcode/vx_statistics/contable_nx2.cc | 3 +++ src/libcode/vx_statistics/met_stats.cc | 8 ++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/libcode/vx_statistics/contable.cc b/src/libcode/vx_statistics/contable.cc index 9fd8dcfaee..b0e2e2d5e1 100644 --- a/src/libcode/vx_statistics/contable.cc +++ b/src/libcode/vx_statistics/contable.cc @@ -646,6 +646,7 @@ void TTContingencyTable::set_size(int NR, int NC) { TTContingencyTable finley() { TTContingencyTable t; + t.set_n_pairs(2803); t.set_fy_oy(28); t.set_fn_oy(23); t.set_fy_on(72); @@ -665,6 +666,7 @@ TTContingencyTable finley() { TTContingencyTable finley_always_no() { TTContingencyTable t; + t.set_n_pairs(2803); t.set_fy_oy(0); t.set_fn_oy(51); t.set_fy_on(0); diff --git a/src/libcode/vx_statistics/contable_nx2.cc b/src/libcode/vx_statistics/contable_nx2.cc index bb09a12d32..dbd4e00d27 100644 --- a/src/libcode/vx_statistics/contable_nx2.cc +++ b/src/libcode/vx_statistics/contable_nx2.cc @@ -541,6 +541,9 @@ TTContingencyTable Nx2ContingencyTable::ctc_by_row(int row) const { exit(1); } + // Store the number of pairs + tt.set_n_pairs(Npairs); + double sy = 0.0; double sn = 0.0; diff --git a/src/libcode/vx_statistics/met_stats.cc b/src/libcode/vx_statistics/met_stats.cc index 5ed543138b..f40827f606 100644 --- a/src/libcode/vx_statistics/met_stats.cc +++ b/src/libcode/vx_statistics/met_stats.cc @@ -428,10 +428,10 @@ void CTSInfo::compute_ci() { void CTSInfo::set_stat_ctc(const string &stat_name, double v) { if(stat_name == "TOTAL") cts.set_n_pairs(nint(v)); - else if(stat_name == "FY_OY") cts.set_fy_oy(nint(v)); - else if(stat_name == "FY_ON") cts.set_fy_on(nint(v)); - else if(stat_name == "FN_OY") cts.set_fn_oy(nint(v)); - else if(stat_name == "FN_ON") cts.set_fn_on(nint(v)); + else if(stat_name == "FY_OY") cts.set_fy_oy(v); + else if(stat_name == "FY_ON") cts.set_fy_on(v); + else if(stat_name == "FN_OY") cts.set_fn_oy(v); + else if(stat_name == "FN_ON") cts.set_fn_on(v); else if(stat_name == "EC_VALUE") cts.set_ec_value(v); return;