From 88772c491a2cafef69ffe26674912f077df5f06e Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 25 May 2013 12:00:12 +0200 Subject: [PATCH] Corrected the Degrees of Freedom in the Regression Coefficient Significance MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported and Tested by: Olaf Nöhring. --- src/language/stats/regression.c | 2 +- tests/language/stats/regression.at | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/language/stats/regression.c b/src/language/stats/regression.c index 1ec00c9f33..46853b7f99 100644 --- a/src/language/stats/regression.c +++ b/src/language/stats/regression.c @@ -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); } diff --git a/tests/language/stats/regression.at b/tests/language/stats/regression.at index e7d8904122..eb978f51e4 100644 --- a/tests/language/stats/regression.at +++ b/tests/language/stats/regression.at @@ -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 ,,,,,, -- 2.30.2