Corrected the Degrees of Freedom in the Regression Coefficient Significance
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 25 May 2013 10:00:12 +0000 (12:00 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 25 May 2013 10:00:12 +0000 (12:00 +0200)
Reported and Tested by: Olaf Nöhring.

src/language/stats/regression.c
tests/language/stats/regression.at

index 1ec00c9f33806f9fc9e6db6605423fa4411928ef..46853b7f990099dcd3738d898a95da2772b8358c 100644 (file)
@@ -832,7 +832,7 @@ reg_stats_coeff (linreg * c, void *aux_, const struct variable *var)
       */
       pval =
        2 * gsl_cdf_tdist_Q (fabs (t_stat),
-                            (double) (linreg_n_obs (c) - linreg_n_coeffs (c)));
+                            (double) (linreg_n_obs (c) - linreg_n_coeffs (c) - 1));
       tab_double (t, 6, this_row, 0, pval, NULL);
       ds_destroy (&tstr);
     }
index e7d89041226ca04452fe47330bb5a61abeed277b..eb978f51e42117751c255b43ba375db3f28c4ca1 100644 (file)
@@ -40,7 +40,7 @@ Table: ANOVA (v2)
 Table: Coefficients (v2)
 ,,B,Std. Error,Beta,t,Significance
 ,(Constant),2.19,2.36,.00,.93,.38
-,v0,1.81,1.05,.17,1.72,.12
+,v0,1.81,1.05,.17,1.72,.13
 ,v1,-3.43,.33,-1.03,-10.33,.00
 ,,,,,,