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

New file. Added documentation for the following analysis tools:

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

	* doc/C/analysis-tools.sgml: New file. Added documentation for the
 	following analysis tools: Correlation, Covariance, Descriptive
 	Statistics, Random Number Generation, Sampling, and F-Test.

	* src/dialog-analysis-tools.c: Added some default parameters for
 	the random number generation tool.

	* src/dialog-analysis-tools.c, src/analysis-tools.c: Started the
 	implementation of regression tool.  Feel free to fill in the rest
 	of the calculations if you are familiar with the regression
 	statistics.
parent ca54dab3
......@@ -21,6 +21,8 @@ Jukka:
- Implemented F-Test Tool
- Implemented Random Number Generation Tool with the following
distributions: Discrete, Normal, and Uniform.
- Started implementation of Regression Tool
- Added some documentation about these tools
* Added the following functions:
- FORECAST() and INTERCEPT().
* And fixed these functions:
......
1999-07-08 Jukka-Pekka Iivonen <iivonen@iki.fi>
* doc/C/analysis-tools.sgml: New file. Added documentation for the
following analysis tools: Correlation, Covariance, Descriptive
Statistics, Random Number Generation, Sampling, and F-Test.
* src/dialog-analysis-tools.c: Added some default parameters for
the random number generation tool.
* src/dialog-analysis-tools.c, src/analysis-tools.c: Started the
implementation of regression tool. Feel free to fill in the rest
of the calculations if you are familiar with the regression
statistics.
1999-07-08 Michael Meeks <michael@edenproject.org>
* src/eval.c (add_tree_deps): Change exprt to expr_tree.
......
1999-07-08 Jukka-Pekka Iivonen <iivonen@iki.fi>
* doc/C/analysis-tools.sgml: New file. Added documentation for the
following analysis tools: Correlation, Covariance, Descriptive
Statistics, Random Number Generation, Sampling, and F-Test.
* src/dialog-analysis-tools.c: Added some default parameters for
the random number generation tool.
* src/dialog-analysis-tools.c, src/analysis-tools.c: Started the
implementation of regression tool. Feel free to fill in the rest
of the calculations if you are familiar with the regression
statistics.
1999-07-08 Michael Meeks <michael@edenproject.org>
* src/eval.c (add_tree_deps): Change exprt to expr_tree.
......
1999-07-08 Jukka-Pekka Iivonen <iivonen@iki.fi>
* doc/C/analysis-tools.sgml: New file. Added documentation for the
following analysis tools: Correlation, Covariance, Descriptive
Statistics, Random Number Generation, Sampling, and F-Test.
* src/dialog-analysis-tools.c: Added some default parameters for
the random number generation tool.
* src/dialog-analysis-tools.c, src/analysis-tools.c: Started the
implementation of regression tool. Feel free to fill in the rest
of the calculations if you are familiar with the regression
statistics.
1999-07-08 Michael Meeks <michael@edenproject.org>
* src/eval.c (add_tree_deps): Change exprt to expr_tree.
......
1999-07-08 Jukka-Pekka Iivonen <iivonen@iki.fi>
* doc/C/analysis-tools.sgml: New file. Added documentation for the
following analysis tools: Correlation, Covariance, Descriptive
Statistics, Random Number Generation, Sampling, and F-Test.
* src/dialog-analysis-tools.c: Added some default parameters for
the random number generation tool.
* src/dialog-analysis-tools.c, src/analysis-tools.c: Started the
implementation of regression tool. Feel free to fill in the rest
of the calculations if you are familiar with the regression
statistics.
1999-07-08 Michael Meeks <michael@edenproject.org>
* src/eval.c (add_tree_deps): Change exprt to expr_tree.
......
<sect1 id="analysis-tools">
<title>Data Analysis Tools</title>
<para>Data analysis tools package contains various tools for
statistical data analysis, random number generation and data
sampling. To use these tools select the ``Data Analysis...'' entry
in the ``Tools'' menu. This gives you a list of tools to choose
from. Select one of the tools from the list and press the OK
button. The tools are described bellow.</para>
<para>All the tools have the same output options. The results can
be printed out into a new sheet or to the same sheet into a given
output range. To select the output method just select one of the
radio buttons bellow the ``Output options:'' label. Note that if
the output is printed into a range that is too small, some or all of
the results will not be printed.</para>
<sect2>
<title>Correlation Tool</title>
<para>The correlation tool calculates correlation coefficients of
given variables. Use this tool to calculate any number of
correlation coefficients at the same time. The variables for
which the correlations are calulated are specified by the ``Input
Range:'' entry. The given range can be groupped either by
columns or by rows.</para>
<para>For example, you want to calculate the correlation between
two variables, one in a column A and the other in a column B.
Both variables have 10 values in rows between one and ten. First
you should enter A1:B10 to the ``Input Range:'' entry. Secondly,
select the ``Columns'' radio button next to the ``Groupped By:''
label. Then specify the output options described above and press
the OK button.</para>
<para>If you have labels, for example the names of the variables,
in the first row of the given range, you should check the
``Labels in First Row'' button on. This leaves the first row of
the input range out of the analysis. In addition, the names of
the variables are printed nicely into the output table.</para>
<para>The results are printed into a table where each column and
row is labeled according to the names of the variables. If the
names are not given in the first row of the input range, the
column or row numbers are used instead. The calculated
correlations are given in the table. For example, the
correlation of the previous example, i.e, correlation between a
variable in a column A and B, can be read in the second column
and third row of the results table (bellow the column labeled
``Column 1'' and in the row labeled ``Column 2'').</para>
</sect2>
<sect2>
<title>Covariance Tool</title>
<para>The covariance tool calculates covariance of given
variables. Use this tool to calculate any number of covariances
at the same time. The variables for which the covariances are
calulated are specified by the ``Input Range:'' entry. The given
range can be groupped either by columns or by rows.</para>
<para>For example, you want to calculate the covarance of two
variables, one in a column A and the other in a column B. Both
variables have 10 values in rows between one and ten. First you
should enter A1:B10 to the ``Input Range:'' entry. Secondly,
select the ``Columns'' radio button next to the ``Groupped By:''
label. Then specify the output options described above and press
the OK button.</para>
<para>If you have labels, for example the names of the variables,
in the first row of the given range, you should check the
``Labels in First Row'' button on. This leaves the first row of
the input range out of the analysis. In addition, the names of
the variables are printed nicely into the output table.</para>
<para>The results are printed into a table where each column and
row is labeled according to the names of the variables. If the
names are not given in the first row of the input range, the
column or row numbers are used instead. The calculated
covariances are given in the table. For example, the covariance
of the previous example, i.e, covariance between a variable in a
column A and B, can be read in the second column and third row of
the results table (bellow the column labeled ``Column 1'' and in
the row labeled ``Column 2'').</para>
</sect2>
<sect2>
<title>Descriptive Statistics Tool</title>
<para>The descriptive statistics tool calculates some statistical
information of the given variables. Use this tool to calculate
general statistical measures and confidence levels for mean for
any number variables at the same time. The variables for which
the statistical analysis is made are specified by the ``Input
Range:'' entry. The given range can be groupped either by
columns or by rows.</para>
<para>This tool can produce four different kinds of statistical
data. The summary statistics is produced if the button
``Summary Statistics'' is checked on. This tool calculates the
mean, standard error, median, mode, standard deviation, sample
variance, kurtosis, skewness, range, minimum, maximum, sum, and
count for each given variable.</para>
<para>If ``Conficence Level for Mean'' button is checked on, the
tool calculates the confidence level for mean for each variable.
You should specify the percentage of the confidence in the entry
box. The default value is to calculate the confidence level of
95%.</para>
<para>If ``Kth Largest:'' button is checked on, the tool finds
the kth largest value of each of the variables. Specify the k in
the entry box next to the check button.</para>
<para>If ``Kth Smallest:'' button is checked on, the tool finds
the kth smallest value of each of the variables. Specify the k in
the entry box next to the check button.</para>
<para>If you have labels, for example the names of the variables,
in the first row of the given range, you should check the
``Labels in First Row'' button on. This leaves the first row of
the input range out of the analysis. In addition, the names of
the variables are printed nicely into the output table.</para>
</sect2>
<sect2>
<title>F-Test:Two-Sample for Variances Tool</title>
<para>Use the F-Test tool to analyze wheater the variances of two
variables are significantly different or not. The values of the
first variable are specified in the ``Variable 1 Range:'' entry.
Correspondingly, the values of the second variable are given in
the ``Variable 2 Range:'' entry. ``Alpha:'' entry specifies the
level of significance which is by default 95%.</para>
<para>If the output is printed into a range, it should contain at
least three columns and eight rows.</para>
<para>The results are given in a table. The tool calculates and
prints the mean, variance, count of observations and the degree
of freedom for both variables. It also calculates the F-value,
the one-tailed probability for the F-value, and the F Critical
value for one-tailed test. The one-tailed probability for the
F-value (``P(F<=f) one-tail'' row) describes the risk of making a
Type I error of one-tailed test.</para>
</sect2>
<sect2>
<title>Random Number Generation Tool</title>
<para>Use the random number generation tool to generate random
numbers. This tool can generate random numbers having different
probability distributions.</para>
<para>To use this tool, first specify the number of variables in
the ``Number of Variables:'' entry box. This determines the
number of columns of random values to be produced. Secondly,
specify the number of random numbers. This determines the number
of rows of random values to be produced. Thirdly specify the
random distribution by selecting one of the list items from the
random distribution list. The following random distributions are
supported: discrete, normal, and uniform. Then specify the
parameters of the distribution.</para>
<para>For discrete random distribution, specify the value and
probability input range in the ``Value and Probability Input
Range:'' entry box. That is a table consisting of two columns
and any number of rows. The first column specifies the discrete
random values and the second column the probabilities of them.
The discrete random values do not have to be numbers, for
example, strings will do as well. The sum of the probabilities
in the second column should be one. For example, if you have the
values A, B, C, and D in A1:A4 and values 0.1, 0.4, 0.2, and 0.3
in B1:B4, you could specify value and probability input range to
be A1:B4.</para>
<para>For normal random distribution, specify the mean and the
standard deviation. The default values for them are 0 for mean
and 1 for standard deviation.</para>
<para>For uniform random distribution, specify the range of the
random variables by filling the ``Between:'' and ``And:'' entries.
The default values for them are 0 and 1 that gives random numbers
between zero and one.</para>
</sect2>
<sect2>
<title>Sampling Tool</title>
<para>Use the sampling tool to take a sample of a data set. This
tool can take both a random sample of a given size or a periodic
sample where, for example, every fourth value of the data set is
taken to the sample.</para>
<para>To use this tool, first specify the data set by setting the
``Input Range:'' entry. Then select the sampling method which
can be either periodic or random. Periodic sampling requires
that you specify the period by typing a number to the ``Period:''
entry. For example, if you specify the period to be three then
you will get a sample that has every third value of the original
data set. Random sampling requires that you specify the size of
the random sample in ``Number of Samples:'' entry. The size
cannot be larger than the original data set since each value of
the original data set is taken at most once to the sample.</para>
</sect2>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
......@@ -234,8 +234,6 @@ free_data_set(data_set_t *data)
* 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.
*
* TODO: a new workbook output and output to an existing sheet
*
**/
......@@ -364,8 +362,6 @@ correlation_tool (Workbook *wb, Sheet *current_sheet,
* 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.
*
* TODO: a new workbook output and output to an existing sheet
*
**/
......@@ -490,8 +486,6 @@ covariance_tool (Workbook *wb, Sheet *current_sheet,
* 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.
*
* TODO: a new workbook output and output to an existing sheet
*
**/
......@@ -820,8 +814,6 @@ descriptive_stat_tool (Workbook *wb, Sheet *current_sheet,
* out in a new sheet, in a new workbook, or simply into an existing
* sheet.
*
* TODO: a new workbook output and output to an existing sheet
*
**/
......@@ -939,8 +931,6 @@ int sampling_tool (Workbook *wb, Sheet *sheet, Range *input_range,
* 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.
*
* TODO: a new workbook output and output to an existing sheet
*
**/
......@@ -1042,8 +1032,6 @@ int ztest_tool (Workbook *wb, Sheet *sheet, Range *input_range1,
* in a table which can be printed out in a new sheet, in a new
* workbook, or simply into an existing sheet.
*
* TODO: a new workbook output and output to an existing sheet
*
**/
......@@ -1399,8 +1387,6 @@ ttest_neq_var_tool (Workbook *wb, Sheet *sheet, Range *input_range1,
* 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.
*
* TODO: a new workbook output and output to an existing sheet
*
**/
......@@ -1498,8 +1484,6 @@ ftest_tool (Workbook *wb, Sheet *sheet, Range *input_range1,
* 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.
*
* TODO: a new workbook output and output to an existing sheet
*
**/
int random_tool (Workbook *wb, Sheet *sheet, int vars, int count,
......@@ -1621,3 +1605,118 @@ int random_tool (Workbook *wb, Sheet *sheet, int vars, int count,
return 0;
}
/************* Regression 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 regression_tool (Workbook *wb, Sheet *sheet, Range *input_range1,
Range *input_range2, float_t alpha,
data_analysis_output_t *dao)
{
data_set_t set_one, set_two;
float_t mean1, mean2;
float_t r, ss_xy, ss_xx, ss_yy;
char buf[256];
GSList *current_one, *current_two;
get_data(sheet, input_range1, &set_one);
get_data(sheet, input_range2, &set_two);
if (set_one.n != set_two.n) {
free_data_set(&set_one);
free_data_set(&set_two);
return 1;
}
if (dao->type == NewSheetOutput) {
dao->sheet = sheet_new(wb, "Regression");
dao->start_col = dao->start_row = 0;
workbook_attach_sheet(wb, dao->sheet);
}
set_cell (dao, 0, 0, "SUMMARY OUTPUT");
set_cell (dao, 0, 2, "Regression Statistics");
set_cell (dao, 0, 3, "Multiple R");
set_cell (dao, 0, 4, "R Square");
set_cell (dao, 0, 5, "Adjusted R Square");
set_cell (dao, 0, 6, "Standard Error");
set_cell (dao, 0, 7, "Observations");
set_cell (dao, 0, 9, "ANOVA");
set_cell (dao, 0, 11, "Regression");
set_cell (dao, 0, 12, "Residual");
set_cell (dao, 0, 13, "Total");
set_cell (dao, 0, 16, "Intercept");
set_cell (dao, 0, 17, "X Variable 1");
set_cell (dao, 1, 10, "df");
set_cell (dao, 2, 10, "SS");
set_cell (dao, 3, 10, "MS");
set_cell (dao, 4, 10, "F");
set_cell (dao, 5, 10, "Significance F");
set_cell (dao, 1, 15, "Coefficients");
set_cell (dao, 2, 15, "Standard Error");
set_cell (dao, 3, 15, "t Stat");
set_cell (dao, 4, 15, "P-value");
set_cell (dao, 5, 15, "Lower 95%");
set_cell (dao, 6, 15, "Upper 95%");
mean1 = set_one.sum / set_one.n;
mean2 = set_two.sum / set_two.n;
current_one = set_one.array;
current_two = set_two.array;
ss_xy = ss_xx = ss_yy = 0;
while (current_one != NULL && current_two != NULL) {
float_t x, y;
x = *((float_t *) current_one->data);
y = *((float_t *) current_two->data);
ss_xy += (x - mean1) * (y - mean2);
ss_xx += (x - mean1) * (x - mean1);
ss_yy += (y - mean2) * (y - mean2);
current_one = current_one->next;
current_two = current_two->next;
}
r = ss_xy/sqrt(ss_xx*ss_yy);
/* Multiple R */
sprintf(buf, "%f", r);
set_cell(dao, 1, 3, buf);
/* R Square */
sprintf(buf, "%f", r*r);
set_cell(dao, 1, 4, buf);
/* Observations */
sprintf(buf, "%d", set_one.n);
set_cell(dao, 1, 7, buf);
/* Total / df */
sprintf(buf, "%d", set_one.n-1);
set_cell(dao, 1, 13, buf);
/* Total / SS */
sprintf(buf, "%f", ss_xx);
set_cell(dao, 2, 13, buf);
/* TODO: Fill in the rest of the outputs */
free_data_set(&set_one);
free_data_set(&set_two);
return 0;
}
......@@ -25,6 +25,7 @@ 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_random_tool(Workbook *wb, Sheet *sheet);
static void dialog_regression_tool(Workbook *wb, Sheet *sheet);
static descriptive_stat_tool_t ds;
......@@ -55,7 +56,7 @@ typedef struct {
typedef struct {
GtkWidget *dialog;
GtkWidget *frame;
GtkWidget *discrete_box, *uniform_box, *normal_box;
GtkWidget *discrete_box, *uniform_box, *normal_box, *poisson_box;
GtkWidget *combo;
} random_tool_callback_t;
......@@ -72,6 +73,8 @@ tool_list_t tools[] = {
dialog_ftest_tool },
{ { "Random Number Generation", NULL },
dialog_random_tool },
{ { "Regression", NULL },
dialog_regression_tool },
{ { "Sampling", NULL },
dialog_sampling_tool },
{ { "t-Test: Paired Two Sample for Means", NULL },
......@@ -514,7 +517,6 @@ dialog_sampling_tool(Workbook *wb, Sheet *sheet)
static GtkWidget *dialog, *box, *sampling_box, *sampling_label;
static GtkWidget *range_entry, *output_range_entry, *sampling_entry[2];
static GSList *sampling_ops, *output_ops;
static int labels = 0;
data_analysis_output_t dao;
......@@ -523,8 +525,6 @@ dialog_sampling_tool(Workbook *wb, Sheet *sheet)
static Range range;
int i=0, size;
label_row_flag = labels;
if (!dialog) {
dialog = new_dialog("Sampling", wb->toplevel);
......@@ -571,8 +571,6 @@ dialog_sampling_tool(Workbook *wb, Sheet *sheet)
}
gtk_box_pack_start_defaults(GTK_BOX (box), sampling_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);
......@@ -613,10 +611,6 @@ sampling_dialog_loop:
text = gtk_entry_get_text (GTK_ENTRY (sampling_entry[i]));
size = atoi(text);
labels = label_row_flag;
if (labels)
range.start_row++;
if (sampling_tool (wb, sheet, &range, !i, size, &dao))
goto sampling_dialog_loop;
......@@ -1327,6 +1321,7 @@ dialog_random_tool(Workbook *wb, Sheet *sheet)
static GtkWidget *discrete_range_entry;
static GtkWidget *uniform_upper_entry, *uniform_lower_entry;
static GtkWidget *normal_mean_entry, *normal_stdev_entry;
static GtkWidget *poisson_lambda_entry;
static GSList *group_ops, *output_ops;
static GList *distribution_type_strs;
......@@ -1386,17 +1381,21 @@ dialog_random_tool(Workbook *wb, Sheet *sheet)
callback_data.uniform_box = gtk_vbox_new (FALSE, 0);
uniform_lower_entry =
pack_label_and_entry("Between:", "", 20,
pack_label_and_entry("Between:", "0", 20,
callback_data.uniform_box);
uniform_upper_entry =
pack_label_and_entry("And:", "", 20,
pack_label_and_entry("And:", "1", 20,
callback_data.uniform_box);
callback_data.normal_box = gtk_vbox_new (FALSE, 0);
normal_mean_entry = pack_label_and_entry
("Mean = ", "", 20, callback_data.normal_box);
("Mean = ", "0", 20, callback_data.normal_box);
normal_stdev_entry = pack_label_and_entry
("Standard Deviation = ", "", 20, callback_data.normal_box);
("Standard Deviation = ", "1", 20, callback_data.normal_box);
callback_data.poisson_box = gtk_vbox_new (FALSE, 0);
poisson_lambda_entry = pack_label_and_entry
("Lambda", "0", 20, callback_data.poisson_box);
box = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start_defaults (GTK_BOX (GNOME_DIALOG
......@@ -1493,6 +1492,105 @@ random_dialog_loop:
gnome_dialog_close (GNOME_DIALOG (dialog));
}
static void
dialog_regression_tool(Workbook *wb, Sheet *sheet)
{
static GtkWidget *dialog, *box, *vbox;
static GtkWidget *range1_entry, *range2_entry, *output_range_entry;
static GtkWidget *alpha_entry;
static GSList *output_ops;
static int labels = 0;
data_analysis_output_t dao;
float_t alpha;
char *text;
int selection, output;
static Range range_input1, range_input2;
if (!dialog) {
dialog = new_dialog("Regression", 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);
range1_entry = hbox_pack_label_and_entry
("Input Y Range:", "", 20, vbox);
range2_entry = hbox_pack_label_and_entry
("Input X Range:", "", 20, vbox);
alpha_entry = hbox_pack_label_and_entry("Confidence Level:",
"0.95", 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);
output_range_entry = add_output_frame(box, &output_ops);
gtk_widget_show_all (dialog);
} else
gtk_widget_show_all (dialog);
gtk_widget_grab_focus (range1_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 (range1_entry));
if (!parse_range (text, &range_input1.start_col,
&range_input1.start_row,
&range_input1.end_col,
&range_input1.end_row)) {
error_in_entry(wb, range1_entry,
"You should introduce a valid cell range "
"in 'Variable 1:'");
goto dialog_loop;
}
text = gtk_entry_get_text (GTK_ENTRY (range2_entry));
if (!parse_range (text, &range_input2.start_col,
&range_input2.start_row,
&range_input2.end_col,
&range_input2.end_row)) {
error_in_entry(wb, range2_entry,
"You should introduce a valid cell range "
"in 'Variable 2:'");
goto dialog_loop;
}
text = gtk_entry_get_text (GTK_ENTRY (alpha_entry));
alpha = atof(text);
if (parse_output(output, sheet, output_range_entry, wb, &dao))
goto dialog_loop;
labels = label_row_flag;
if (labels) {
range_input1.start_row++;
range_input2.start_row++;
}
if (regression_tool (wb, sheet, &range_input1,
&range_input2, alpha, &dao))
goto dialog_loop;
workbook_focus_sheet(sheet);
gnome_dialog_close (GNOME_DIALOG (dialog));
}
static void
selection_made(GtkWidget *clist, gint row, gint column,
......
......@@ -112,6 +112,9 @@ int sampling_tool (Workbook *wb, Sheet *sheet, Range *input_range,
int ftest_tool (Workbook *wb, Sheet *sheet, Range *input_range1,
Range *input_range2, float_t alpha,
data_analysis_output_t *dao);
int regression_tool (Workbook *wb, Sheet *sheet, Range *input_range1,
Range *input_range2, float_t alpha,
data_analysis_output_t *dao);
int ttest_paired_tool (Workbook *wb, Sheet *sheet, Range *input_range1,
Range *input_range2, float_t mean_diff, float_t alpha,
data_analysis_output_t *dao);
......
......@@ -25,6 +25,7 @@ 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_random_tool(Workbook *wb, Sheet *sheet);
static void dialog_regression_tool(Workbook *wb, Sheet *sheet);
static descriptive_stat_tool_t ds;
......@@ -55,7 +56,7 @@ typedef struct {
typedef struct {
GtkWidget *dialog;
GtkWidget *frame;
GtkWidget *discrete_box, *uniform_box, *normal_box;
GtkWidget *discrete_box, *uniform_box, *normal_box, *poisson_box;
GtkWidget *combo;
} random_tool_callback_t;
......@@ -72,6 +73,8 @@ tool_list_t tools[] = {
dialog_ftest_tool },
{ { "Random Number Generation", NULL },
dialog_random_tool },
{ { "Regression", NULL },
dialog_regression_tool },
{ { "Sampling", NULL },
dialog_sampling_tool },
{ { "t-Test: Paired Two Sample for Means", NULL },
......@@ -514,7 +517,6 @@ dialog_sampling_tool(Workbook *wb, Sheet *sheet)
static GtkWidget *dialog, *box, *sampling_box, *sampling_label;
static GtkWidget *range_entry, *output_range_entry, *sampling_entry[2];
static GSList *sampling_ops, *output_ops;
static int labels = 0;
data_analysis_output_t dao;
......@@ -523,8 +525,6 @@ dialog_sampling_tool(Workbook *wb, Sheet *sheet)
static Range range;
int i=0, size;
label_row_flag = labels;
if (!dialog) {
dialog = new_dialog("Sampling", wb->toplevel);
......@@ -571,8 +571,6 @@ dialog_sampling_tool(Workbook *wb, Sheet *sheet)