Skip to content

Commit

Permalink
Per #1749, simplify the logic so that the expected correct value for …
Browse files Browse the repository at this point in the history
…square contingency tables is initialized to 1/size. Then, prevent that default value from being overriden with bad data.
  • Loading branch information
JohnHalleyGotway committed Jun 13, 2021
1 parent 3b9a01a commit c2bab0c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion met/src/libcode/vx_statistics/contable.cc
Expand Up @@ -464,6 +464,16 @@ void ContingencyTable::set_size(int N)

ContingencyTable::set_size(N, N);

//
// if square, set default expected correct value
//

if ( N > 0 ) {

ECvalue = 1.0 / N;

}

return;

}
Expand Down Expand Up @@ -513,7 +523,11 @@ void ContingencyTable::set_ec_value(double v)

{

ECvalue = v;
//
// do not override the default value with bad data
//

if ( !is_bad_data(v) ) ECvalue = v;

return;

Expand Down

0 comments on commit c2bab0c

Please sign in to comment.