[gnumeric] Adjust regression tool to reflect the changes to TDIST.



commit 1a8408a6810ea13e08ba1e519f6377021b898235
Author: Andreas J. Guelzow <aguelzow math concordia ab ca>
Date:   Fri Apr 9 11:31:44 2010 -0600

    Adjust regression tool to reflect the changes to TDIST.
    
    2010-04-09 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* analysis-tools.c (analysis_tool_regression_engine_run): wrap the
    	  first argument to TDIST with ABS.

 NEWS                       |    1 +
 src/tools/ChangeLog        |    5 +++++
 src/tools/analysis-tools.c |    6 +++++-
 3 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index c43030a..10491f9 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Andreas:
 	* Fix ZTEST description. [#614746]
 	* Don't write unnecessary manifest entries in ODF export.
 	* Various ODF export fixes.
+	* Adjust regression tool to reflect the changes to TDIST.
 
 Morten:
 	* Improve object sizing tooltip positioning a bit.
diff --git a/src/tools/ChangeLog b/src/tools/ChangeLog
index 4a24143..199e73f 100644
--- a/src/tools/ChangeLog
+++ b/src/tools/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-09 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* analysis-tools.c (analysis_tool_regression_engine_run): wrap the 
+	  first argument to TDIST with ABS.
+
 2010-03-31 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* analysis-tools.h (analysis_tools_data_regression_t): add fields
diff --git a/src/tools/analysis-tools.c b/src/tools/analysis-tools.c
index 40ecf27..6629293 100644
--- a/src/tools/analysis-tools.c
+++ b/src/tools/analysis-tools.c
@@ -2846,6 +2846,7 @@ analysis_tool_regression_engine_run (data_analysis_output_t *dao,
 	GnmFunc *fd_sum;
 	GnmFunc *fd_sqrt;
 	GnmFunc *fd_tdist;
+	GnmFunc *fd_abs;
 	GnmFunc *fd_tinv;
 	GnmFunc *fd_transpose;
 	GnmFunc *fd_concatenate = NULL;
@@ -2868,6 +2869,8 @@ analysis_tool_regression_engine_run (data_analysis_output_t *dao,
 	gnm_func_ref (fd_sqrt);
 	fd_tdist = gnm_func_lookup_or_add_placeholder ("TDIST", dao->sheet ? dao->sheet->workbook : NULL, FALSE);
 	gnm_func_ref (fd_tdist);
+	fd_abs = gnm_func_lookup_or_add_placeholder ("ABS", dao->sheet ? dao->sheet->workbook : NULL, FALSE);
+	gnm_func_ref (fd_abs);
 	fd_tinv = gnm_func_lookup_or_add_placeholder ("TINV", dao->sheet ? dao->sheet->workbook : NULL, FALSE);
 	gnm_func_ref (fd_tinv);
 	fd_transpose = gnm_func_lookup_or_add_placeholder ("TRANSPOSE", dao->sheet ? dao->sheet->workbook : NULL, FALSE);
@@ -3158,7 +3161,7 @@ analysis_tool_regression_engine_run (data_analysis_output_t *dao,
 				       GNM_EXPR_OP_DIV,
 				       make_cellref (-1, 0));
 	expr_df = dao_get_cellref (dao, 1, 12);
-	expr_pvalue = gnm_expr_new_funcall3 (fd_tdist, make_cellref (-1, 0),
+	expr_pvalue = gnm_expr_new_funcall3 (fd_tdist, gnm_expr_new_funcall1 (fd_abs, make_cellref (-1, 0)),
 					     gnm_expr_copy (expr_df),
 					     gnm_expr_new_constant (value_new_int (2)));
 	expr_lower = gnm_expr_new_binary (make_cellref (-4, 0),
@@ -3274,6 +3277,7 @@ analysis_tool_regression_engine_run (data_analysis_output_t *dao,
 	gnm_func_unref (fd_sum);
 	gnm_func_unref (fd_sqrt);
 	gnm_func_unref (fd_tdist);
+	gnm_func_unref (fd_abs);
 	gnm_func_unref (fd_tinv);
 	gnm_func_unref (fd_transpose);
 	if (fd_concatenate != NULL)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]