Skip to content

Commit

Permalink
Per #2887, update ctc_by_row() logic to create reproducible results w…
Browse files Browse the repository at this point in the history
…ith the develop branch.
  • Loading branch information
JohnHalleyGotway committed Sep 3, 2024
1 parent f2a1fd0 commit 8c629e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/libcode/vx_statistics/contable_nx2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -543,18 +543,21 @@ TTContingencyTable Nx2ContingencyTable::ctc_by_row(int row) const {
exit(1);
}

double sy;
double sn;
double sy = 0.0;
double sn = 0.0;

for(int j=(row + 1), sy=sn=0.0; j<Nrows; ++j) {
for(int j=row+1; j<Nrows; ++j) {
sy += event_count_by_row(j);
sn += nonevent_count_by_row(j);
}

tt.set_fy_oy(sy);
tt.set_fy_on(sn);

for(int j=0, sy=sn=0.0; j<=row; ++j) {
sy = 0.0;
sn = 0.0;

for(int j=0; j<=row; ++j) {
sy += event_count_by_row(j);
sn += nonevent_count_by_row(j);
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcode/vx_statistics/met_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3470,7 +3470,7 @@ double PCTInfo::get_stat_pjc(const string &stat_name,

double PCTInfo::get_stat_prc(const string &stat_name,
ConcatString &col_name) const {
int i = 0;
int i = bad_data_int;
double v = bad_data_double;
col_name = stat_name;
TTContingencyTable ct;
Expand Down

0 comments on commit 8c629e6

Please sign in to comment.