Logistic Regression: Fix bug where some confidence intervals were not reported.
authorJohn Darrington <john@darrington.wattle.id.au>
Thu, 22 Nov 2012 14:39:48 +0000 (15:39 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Thu, 22 Nov 2012 14:39:48 +0000 (15:39 +0100)
src/language/stats/logistic.c

index e3a66f4de004c81d1c18bd5b80f358fa27465a0b..8e21b175e1d1630938d8aacb95353d45f99d2448 100644 (file)
@@ -1289,10 +1289,14 @@ output_variables (const struct lr_spec *cmd,
 
       if (cmd->print & PRINT_CI)
        {
+         int last_ci = nr;
          double wc = gsl_cdf_ugaussian_Pinv (0.5 + cmd->confidence / 200.0);
          wc *= sqrt (sigma2);
 
-         if (idx < cmd->n_predictor_vars)
+         if (cmd->constant)
+           last_ci--;
+
+         if (row < last_ci)
            {
              tab_double (t, 8, row, 0, exp (b - wc), 0);
              tab_double (t, 9, row, 0, exp (b + wc), 0);