Commit 3e23b872 authored by Jukka-Pekka Iivonen's avatar Jukka-Pekka Iivonen Committed by jpekka

Added an option to all tools to print the results to a new workbook.

1999-07-09  Jukka-Pekka Iivonen  <iivonen@iki.fi>

	* src/dialog-analysis-tools.c, src/analysis-tools.c: Added an
 	option to all tools to print the results to a new workbook.

	* src/dialog-analysis-tools.c, src/analysis-tools.c: Added Moving
 	Average and Rank and Percentile tools.
parent 1fe993a0
......@@ -22,6 +22,8 @@ Jukka:
- Implemented Random Number Generation Tool with the following
distributions: Discrete, Normal, and Uniform.
- Started implementation of Regression Tool
- Implemented Moving Average Tool
- Started implementation of Rank and Percentile Tool
- Added some documentation about these tools
* Added the following functions:
- FORECAST() and INTERCEPT().
......
1999-07-09 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/dialog-analysis-tools.c, src/analysis-tools.c: Added an
option to all tools to print the results to a new workbook.
* src/dialog-analysis-tools.c, src/analysis-tools.c: Added Moving
Average and Rank and Percentile tools.
1999-07-09 Michael Meeks <michael@edenproject.org>
* src/eval.c (add_value_deps): Add warning on default:
......
1999-07-09 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/dialog-analysis-tools.c, src/analysis-tools.c: Added an
option to all tools to print the results to a new workbook.
* src/dialog-analysis-tools.c, src/analysis-tools.c: Added Moving
Average and Rank and Percentile tools.
1999-07-09 Michael Meeks <michael@edenproject.org>
* src/eval.c (add_value_deps): Add warning on default:
......
1999-07-09 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/dialog-analysis-tools.c, src/analysis-tools.c: Added an
option to all tools to print the results to a new workbook.
* src/dialog-analysis-tools.c, src/analysis-tools.c: Added Moving
Average and Rank and Percentile tools.
1999-07-09 Michael Meeks <michael@edenproject.org>
* src/eval.c (add_value_deps): Add warning on default:
......
1999-07-09 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/dialog-analysis-tools.c, src/analysis-tools.c: Added an
option to all tools to print the results to a new workbook.
* src/dialog-analysis-tools.c, src/analysis-tools.c: Added Moving
Average and Rank and Percentile tools.
1999-07-09 Michael Meeks <michael@edenproject.org>
* src/eval.c (add_value_deps): Add warning on default:
......
......@@ -289,6 +289,12 @@ correlation_tool (Workbook *wb, Sheet *current_sheet,
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
cols = input_range->end_col - input_range->start_col + 1;
......@@ -413,6 +419,12 @@ covariance_tool (Workbook *wb, Sheet *current_sheet,
dao->sheet = sheet_new(wb, "Covariances");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
cols = input_range->end_col - input_range->start_col + 1;
......@@ -562,6 +574,12 @@ summary_statistics(Workbook *wb, data_set_t *data_set, int vars,
dao->sheet = sheet_new(wb, "Summary Statistics");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
set_cell (dao, 0, 0, "");
......@@ -679,6 +697,12 @@ confidence_level(Workbook *wb, data_set_t *data_set, int vars, float_t c_level,
dao->sheet = sheet_new(wb, "Confidence Level");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
for (col=0; col<vars; col++) {
......@@ -709,6 +733,12 @@ kth_largest(Workbook *wb, data_set_t *data_set, int vars, int k,
dao->sheet = sheet_new(wb, "kth Largest");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
for (col=0; col<vars; col++) {
......@@ -739,6 +769,12 @@ kth_smallest(Workbook *wb, data_set_t *data_set, int vars, int k,
dao->sheet = sheet_new(wb, "kth Smallest");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
for (col=0; col<vars; col++) {
......@@ -832,6 +868,12 @@ int sampling_tool (Workbook *wb, Sheet *sheet, Range *input_range,
dao->sheet = sheet_new(wb, "Sample");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
get_data(sheet, input_range, &data_set);
......@@ -947,6 +989,12 @@ int ztest_tool (Workbook *wb, Sheet *sheet, Range *input_range1,
dao->sheet = sheet_new(wb, "z-Test");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
get_data(sheet, input_range1, &set_one);
......@@ -1062,6 +1110,12 @@ ttest_paired_tool (Workbook *wb, Sheet *sheet, Range *input_range1,
dao->sheet = sheet_new(wb, "t-Test");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
set_cell (dao, 0, 0, "");
......@@ -1188,6 +1242,12 @@ ttest_eq_var_tool (Workbook *wb, Sheet *sheet, Range *input_range1,
dao->sheet = sheet_new(wb, "t-Test");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
get_data(sheet, input_range1, &set_one);
......@@ -1296,6 +1356,12 @@ ttest_neq_var_tool (Workbook *wb, Sheet *sheet, Range *input_range1,
dao->sheet = sheet_new(wb, "t-Test");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
get_data(sheet, input_range1, &set_one);
......@@ -1405,6 +1471,12 @@ ftest_tool (Workbook *wb, Sheet *sheet, Range *input_range1,
dao->sheet = sheet_new(wb, "F-Test");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
get_data(sheet, input_range1, &set_one);
......@@ -1501,6 +1573,12 @@ int random_tool (Workbook *wb, Sheet *sheet, int vars, int count,
dao->sheet = sheet_new(wb, "Random Numbers");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
switch (distribution) {
......@@ -1638,6 +1716,12 @@ int regression_tool (Workbook *wb, Sheet *sheet, Range *input_range1,
dao->sheet = sheet_new(wb, "Regression");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
set_cell (dao, 0, 0, "SUMMARY OUTPUT");
......@@ -1720,3 +1804,172 @@ int regression_tool (Workbook *wb, Sheet *sheet, Range *input_range1,
return 0;
}
/************* Moving Average Tool *****************************************
*
* The moving average tool calculates moving averages of given data
* set. The results are given in a table which can be printed out in
* a new sheet, in a new workbook, or simply into an existing sheet.
*
**/
int average_tool (Workbook *wb, Sheet *sheet, Range *range, int interval,
int std_error_flag, data_analysis_output_t *dao)
{
data_set_t data_set;
GSList *current;
char buf[256];
Cell *cell;
float_t *prev, sum;
int cols, rows, row, i, add_cursor, del_cursor, count;
int error;
/* TODO: Standard error output */
cols = range->end_col - range->start_col + 1;
rows = range->end_row - range->start_row + 1;
if ((cols != 1 && rows != 1) || interval < 1)
return 1;
if (dao->type == NewSheetOutput) {
dao->sheet = sheet_new(wb, "Moving Averages");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
prev = g_new(float_t, interval);
get_data(sheet, range, &data_set);
current = data_set.array;
count = add_cursor = del_cursor = row = 0;
sum = 0;
while (current != NULL) {
prev[add_cursor] = *((float_t *) current->data);
if (count == interval-1) {
sum += prev[add_cursor];
sprintf(buf, "%f", sum / interval);
set_cell(dao, 0, row, buf);
++row;
sum -= prev[del_cursor];
if (++add_cursor == interval)
add_cursor = 0;
if (++del_cursor == interval)
del_cursor = 0;
} else {
++count;
sum += prev[add_cursor];
++add_cursor;
sprintf(buf, "#N/A");
set_cell(dao, 0, row++, buf);
}
current = current->next;
}
g_free(prev);
free_data_set(&data_set);
return 0;
}
/************* Rank and Percentile Tool ************************************
*
* The results are given in a table which can be printed out in a new
* sheet, in a new workbook, or simply into an existing sheet.
*
**/
int ranking_tool (Workbook *wb, Sheet *sheet, Range *input_range,
int columns_flag, data_analysis_output_t *dao)
{
data_set_t *data_sets;
GSList *current;
char buf[256];
Cell *cell;
int vars, cols, rows, col, row, i, n;
int error;
if (dao->type == NewSheetOutput) {
dao->sheet = sheet_new(wb, "Ranks and Percentiles");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
} else if (dao->type == NewWorkbookOutput) {
wb = workbook_new ();
dao->sheet = sheet_new(wb, "Correlations");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
gtk_widget_show (wb->toplevel);
}
cols = input_range->end_col - input_range->start_col + 1;
rows = input_range->end_row - input_range->start_row + 1;
if (columns_flag) {
vars = cols;
for (col=0; col<vars; col++) {
set_cell (dao, col*4, 0, "Point");
sprintf(buf, "Column %d", col+1);
set_cell (dao, col*4+1, 0, buf);
set_cell (dao, col*4+2, 0, "Rank");
set_cell (dao, col*4+3, 0, "Percent");
}
data_sets = g_new(data_set_t, vars);
for (i=0; i<vars; i++)
get_data_groupped_by_columns(sheet,
input_range, i,
&data_sets[i]);
} else {
vars = rows;
for (col=0; col<vars; col++) {
set_cell (dao, col*4, 0, "Point");
sprintf(buf, "Row %d", col+1);
set_cell (dao, col*4+1, 0, buf);
set_cell (dao, col*4+2, 0, "Rank");
set_cell (dao, col*4+3, 0, "Percent");
}
data_sets = g_new(data_set_t, vars);
for (i=0; i<vars; i++)
get_data_groupped_by_rows(sheet,
input_range, i,
&data_sets[i]);
}
for (i=0; i<vars; i++)
data_sets[i].array = g_slist_sort(data_sets[i].array,
(GCompareFunc) float_compare_desc);
for (i=0; i<vars; i++) {
n = 0;
current = data_sets[i].array;
while (current != NULL) {
float_t x = *((float_t *) current->data);
sprintf(buf, "%f", x);
set_cell (dao, i*4+1, n+1, buf);
sprintf(buf, "%d", n+1);
set_cell (dao, i*4+2, n+1, buf);
sprintf(buf, "%.2f%%",
100.0-(100.0 * n / (data_sets[i].n-1)));
set_cell (dao, i*4+3, n+1, buf);
++n;
current = current->next;
}
}
for (i=0; i<vars; i++)
free_data_set(&data_sets[i]);
return 0;
}
......@@ -19,17 +19,19 @@ static void dialog_correlation_tool(Workbook *wb, Sheet *sheet);
static void dialog_covariance_tool(Workbook *wb, Sheet *sheet);
static void dialog_descriptive_stat_tool(Workbook *wb, Sheet *sheet);
static void dialog_ztest_tool(Workbook *wb, Sheet *sheet);
static void dialog_ranking_tool(Workbook *wb, Sheet *sheet);
static void dialog_sampling_tool(Workbook *wb, Sheet *sheet);
static void dialog_ttest_paired_tool(Workbook *wb, Sheet *sheet);
static void dialog_ttest_eq_tool(Workbook *wb, Sheet *sheet);
static void dialog_ttest_neq_tool(Workbook *wb, Sheet *sheet);
static void dialog_ftest_tool(Workbook *wb, Sheet *sheet);
static void dialog_average_tool(Workbook *wb, Sheet *sheet);
static void dialog_random_tool(Workbook *wb, Sheet *sheet);
static void dialog_regression_tool(Workbook *wb, Sheet *sheet);
static descriptive_stat_tool_t ds;
static int label_row_flag;
static int label_row_flag, standard_errors_flag;
static random_distribution_t distribution = DiscreteDistribution;
......@@ -71,8 +73,12 @@ tool_list_t tools[] = {
dialog_descriptive_stat_tool },
{ { "F-Test: Two-Sample for Variances", NULL },
dialog_ftest_tool },
{ { "Moving Average", NULL },
dialog_average_tool },
{ { "Random Number Generation", NULL },
dialog_random_tool },
{ { "Rank and Percentile", NULL },
dialog_ranking_tool },
{ { "Regression", NULL },
dialog_regression_tool },
{ { "Sampling", NULL },
......@@ -126,6 +132,12 @@ first_row_label_signal_fun()
label_row_flag = !label_row_flag;
}
static void
standard_errors_signal_fun()
{
standard_errors_flag = !standard_errors_flag;
}
static check_button_t desc_stat_buttons[] = {
{ N_("Summary Statistics"), summary_stat_signal_fun, FALSE,
N_("") },
......@@ -144,6 +156,12 @@ static check_button_t first_row_label_button[] = {
{ NULL, NULL }
};
static check_button_t standard_errors_button[] = {
{ N_("Standard Errors"), standard_errors_signal_fun, FALSE,
N_("") },
{ NULL, NULL }
};
static int selected_row;
static int
......@@ -273,7 +291,7 @@ parse_output(int output, Sheet *sheet,
Range range;
text = gtk_entry_get_text (GTK_ENTRY (entry));
if (output == 1 && !parse_range (text, &range.start_col,
if (output == 2 && !parse_range (text, &range.start_col,
&range.start_row,
&range.end_col,
&range.end_row)) {
......@@ -288,6 +306,9 @@ parse_output(int output, Sheet *sheet,
dao->type = NewSheetOutput;
break;
case 1:
dao->type = NewWorkbookOutput;
break;
case 2:
dao->type = RangeOutput;
dao->start_col = range.start_col;
dao->start_row = range.start_row;
......@@ -311,6 +332,10 @@ add_output_frame(GtkWidget *box, GSList **output_ops)
*output_ops = GTK_RADIO_BUTTON (r)->group;
gtk_box_pack_start_defaults (GTK_BOX (box), r);
hbox = gtk_hbox_new (FALSE, 0);
r = gtk_radio_button_new_with_label(*output_ops, "New Workbook");
*output_ops = GTK_RADIO_BUTTON (r)->group;
gtk_box_pack_start_defaults (GTK_BOX (box), r);
hbox = gtk_hbox_new (FALSE, 0);
r = gtk_radio_button_new_with_label(*output_ops,
"Into a Range:");
*output_ops = GTK_RADIO_BUTTON (r)->group;
......@@ -1592,6 +1617,178 @@ dialog_loop:
gnome_dialog_close (GNOME_DIALOG (dialog));
}
static void
dialog_average_tool(Workbook *wb, Sheet *sheet)
{
static GtkWidget *dialog, *box, *vbox;
static GtkWidget *range_entry, *output_range_entry;
static GtkWidget *interval_entry;
static GSList *output_ops;
static int labels = 0;
data_analysis_output_t dao;
int interval;
char *text;
int selection, output;
static Range range;
if (!dialog) {
dialog = new_dialog("Moving Average", wb->toplevel);
box = gtk_vbox_new (FALSE, 0);
vbox = new_frame("Input:", box);
gtk_box_pack_start_defaults (GTK_BOX (GNOME_DIALOG
(dialog)->vbox), box);
range_entry = hbox_pack_label_and_entry
("Input Range:", "", 20, vbox);
interval_entry = hbox_pack_label_and_entry("Interval:", "3",
20, vbox);
add_check_buttons(vbox, first_row_label_button);
box = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start_defaults (GTK_BOX (GNOME_DIALOG
(dialog)->vbox), box);
add_check_buttons(box, standard_errors_button);
output_range_entry = add_output_frame(box, &output_ops);
gtk_widget_show_all (dialog);
} else
gtk_widget_show_all (dialog);
gtk_widget_grab_focus (range_entry);
dialog_loop:
selection = gnome_dialog_run (GNOME_DIALOG (dialog));
if (selection == 1) {
gnome_dialog_close (GNOME_DIALOG (dialog));
return;
}
output = gtk_radio_group_get_selected (output_ops);
text = gtk_entry_get_text (GTK_ENTRY (range_entry));
if (!parse_range (text, &range.start_col,
&range.start_row,
&range.end_col,
&range.end_row)) {
error_in_entry(wb, range_entry,
"You should introduce a valid cell range "
"in 'Range Input:'");
goto dialog_loop;
}
text = gtk_entry_get_text (GTK_ENTRY (interval_entry));
interval = atoi(text);
if (parse_output(output, sheet, output_range_entry, wb, &dao))
goto dialog_loop;
labels = label_row_flag;
if (labels) {
range.start_row++;
range.start_row++;
}
if (average_tool (wb, sheet, &range, interval,
standard_errors_flag, &dao))
goto dialog_loop;
workbook_focus_sheet(sheet);
gnome_dialog_close (GNOME_DIALOG (dialog));
}
static void
dialog_ranking_tool(Workbook *wb, Sheet *sheet)
{
static GtkWidget *dialog, *box, *group_box, *groupped_label;
static GtkWidget *range_entry, *r, *output_range_entry;
static GSList *group_ops, *output_ops;
static int labels = 0;
data_analysis_output_t dao;
char *text;
int selection;
static Range range;
int i=0, output;
label_row_flag = labels;
if (!dialog) {
dialog = new_dialog("Rank and Percentile", wb->toplevel);
box = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start_defaults (GTK_BOX (GNOME_DIALOG
(dialog)->vbox), box);
box = new_frame("Input:", box);
range_entry = hbox_pack_label_and_entry
("Input Range:", "", 20, box);
group_ops = add_groupped_by(box);
add_check_buttons(box, first_row_label_button);
box = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start_defaults (GTK_BOX (GNOME_DIALOG
(dialog)->vbox), box);
output_range_entry = add_output_frame(box, &output_ops);
gtk_widget_show_all (dialog);
} else
gtk_widget_show_all (dialog);
gtk_widget_grab_focus (range_entry);
dialog_loop:
selection = gnome_dialog_run (GNOME_DIALOG (dialog));
if (selection == 1) {
gnome_dialog_close (GNOME_DIALOG (dialog));
return;
}
i = gtk_radio_group_get_selected (group_ops);
output = gtk_radio_group_get_selected (output_ops);
text = gtk_entry_get_text (GTK_ENTRY (range_entry));
if (!parse_range (text, &range.start_col,
&range.start_row,
&range.end_col,
&range.end_row)) {
error_in_entry(wb, range_entry,
"You should introduce a valid cell range "
"in 'Range:'");
goto dialog_loop;
}
if (parse_output(output, sheet, output_range_entry, wb, &dao))
goto dialog_loop;
labels = label_row_flag;
if (labels)
range.start_row++;
if (ranking_tool (wb, sheet, &range, !i, &dao))
goto dialog_loop;
workbook_focus_sheet(sheet);
gnome_dialog_close (GNOME_DIALOG (dialog));
}
static void
selection_made(GtkWidget *clist, gint row, gint column,
GdkEventButton *event, gpointer data)
......
......@@ -131,6 +131,10 @@ int ztest_tool (Workbook *wb, Sheet *sheet, Range *range_input1,
int random_tool (Workbook *wb, Sheet *sheet, int vars, int count,
random_distribution_t distribution,
random_tool_t *param, data_analysis_output_t *dao);
int average_tool (Workbook *wb, Sheet *sheet, Range *range, int interval,
int std_error_flag, data_analysis_output_t *dao);
int ranking_tool (Workbook *wb, Sheet *sheet, Range *input_range,
int columns_flag, data_analysis_output_t *dao);
GList *add_strings_to_glist (const char *strs[]);
......
......@@ -19,17 +19,19 @@ static void dialog_correlation_tool(Workbook *wb, Sheet *sheet);
static void dialog_covariance_tool(Workbook *wb, Sheet *sheet);
static void dialog_descriptive_stat_tool(Workbook *wb, Sheet *sheet);
static void dialog_ztest_tool(Workbook *wb, Sheet *sheet);
static void dialog_ranking_tool(Workbook *wb, Sheet *sheet);
static void dialog_sampling_tool(Workbook *wb, Sheet *sheet);
static void dialog_ttest_paired_tool(Workbook *wb, Sheet *sheet);
static void dialog_ttest_eq_tool(Workbook *wb, Sheet *sheet);
static void dialog_ttest_neq_tool(Workbook *wb, Sheet *sheet);
static void dialog_ftest_tool(Workbook *wb, Sheet *sheet);
static void dialog_average_tool(Workbook *wb, Sheet *sheet);
static void dialog_random_tool(Workbook *wb, Sheet *sheet);
static void dialog_regression_tool(Workbook *wb, Sheet *sheet);
static descriptive_stat_tool_t ds;
static int label_row_flag;
static int label_row_flag, standard_errors_flag;
static random_distribution_t distribution = DiscreteDistribution;
......@@ -71,8 +73,12 @@ tool_list_t tools[] = {
dialog_descriptive_stat_tool },
{ { "F-Test: Two-Sample for Variances", NULL },
dialog_ftest_tool },
{ { "Moving Average", NULL },
dialog_average_tool },
{ { "Random Number Generation", NULL },
dialog_random_tool },
{ { "Rank and Percentile", NULL },
dialog_ranking_tool },
{ { "Regression", NULL },
dialog_regression_tool },
{ { "Sampling", NULL },
......@@ -126,6 +132,12 @@ first_row_label_signal_fun()
label_row_flag = !label_row_flag;
}
static void