Commit 4e13534f authored by Andreas J. Guelzow 's avatar Andreas J. Guelzow

Add Wilcoxon Signed Rank Test tools for one and two populations.

2010-05-31 Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* component/Gnumeric-embed.xml.in: added Wilcoxon Signed-Rank items
      and rearrange into separate statistics menu.
	* src/GNOME_Gnumeric-gtk.xml.in: ditto
	* src/HILDON_Gnumeric-gtk.xml.in: ditto
	* src/wbc-gtk-actions.c: ditto
    (cb_tools_sign_test_two_medians): use new tool
    (cb_tools_wilcoxon_signed_rank_two_medians): new
    (cb_tools_wilcoxon_signed_rank_two_medians): new

2010-05-31 Andreas J. Guelzow <aguelzow@pyrshep.ca>

    * POTFILES.in: added src/tools/analysis-signed-rank-test.c

2010-05-31 Andreas J. Guelzow <aguelzow@pyrshep.ca>

    * POTFILES.in: added src/tools/analysis-signed-rank-test.c

2010-05-31 Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* analysis-signed-rank-test.[ch]: new
	* Makefile.am: add the above
	* analysis-tools.h (analysis_tool_get_function): new
	* analysis-tools.c (analysis_tool_get_function): new
	* analysis-sign-test.h: minor formatting
	* analysis-sign-test.c
	(analysis_tool_sign_test_two_engine_run): fix statistic

2010-05-31 Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* dialogs.h (dialog_sign_test_two_tool): new
	* dialog-analysis-tool-sign-test.c
	(sign_test_tool_update_common_sensitivity_cb): new
	(sign_test_tool_update_sensitivity_cb): split
	(sign_test_two_tool_update_sensitivity_cb): new
	(sign_test_two_tool_ok_clicked_cb): handle Signed-Rank
	(sign_test_tool_ok_clicked_cb): ditto
	(dialog_sign_test_two_tool): new
	(dialog_sign_test_tool): handle Signed-Rank
	* sign-test-two.glade: add radio buttons
	* sign-test.glade: ditto
parent 6c2c4fd3
2010-05-31 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* component/Gnumeric-embed.xml.in: added Wilcoxon Signed-Rank items
and rearrange into separate statistics menu.
* src/GNOME_Gnumeric-gtk.xml.in: ditto
* src/HILDON_Gnumeric-gtk.xml.in: ditto
* src/wbc-gtk-actions.c: ditto
(cb_tools_sign_test_two_medians): use new tool
(cb_tools_wilcoxon_signed_rank_two_medians): new
(cb_tools_wilcoxon_signed_rank_two_medians): new
2010-05-31 Morten Welinder <terra@gnome.org>
* src/hlink.c (gnm_hlink_external_activate): Use go_gtk_url_show.
......
Gnumeric 1.10.6
Andreas:
* Add Wilcoxon Signed Rank Test tools for one and two populations.
Morten:
* Make sure windows for help commands show up on right screen.
......
......@@ -160,48 +160,63 @@
<menuitem action="ToolsScenarioAdd"/>
</menu>
<menuitem action="ToolsSimulation"/>
<menu name="ToolStatisticalAnalysis" action="MenuToolStatisticalAnalysis">
<menu name="ANOVA" action="MenuANOVA">
<menuitem action="ToolsANOVAoneFactor"/>
<menuitem action="ToolsANOVAtwoFactor"/>
</menu>
<menu name="ChiSquareTests" action="MenuContingencyTests">
<menuitem action="ToolsHomogeneity"/>
<menuitem action="ToolsIndependence"/>
</menu>
<menuitem action="ToolsCorrelation"/>
<menuitem action="ToolsCovariance"/>
<menuitem action="ToolsDescStatistics"/>
<menu name="ToolForecast" action="MenuToolForecast">
<menuitem action="ToolsExpSmoothing"/>
<menuitem action="ToolsAverage"/>
</menu>
<menuitem action="ToolsFourier"/>
<menu name="ToolFrequencies" action="MenuToolFrequencies">
<separator/>
<menuitem action="ToolsPlugins"/>
</menu>
<menu name="Statistics" action="MenuStatistics">
<menu name="StatisticsDescriptive" action="MenuStatisticsDescriptive">
<menuitem action="ToolsCorrelation"/>
<menuitem action="ToolsCovariance"/>
<menuitem action="ToolsDescStatistics"/>
<menu name="ToolFrequencies" action="MenuToolFrequencies">
<menuitem action="ToolsFrequency"/>
<menuitem action="ToolsHistogram"/>
</menu>
<menuitem action="ToolsKaplanMeier"/>
<menuitem action="ToolsNormalityTests"/>
<menuitem action="ToolsPrincipalComponents"/>
<menuitem action="ToolsRanking"/>
<menuitem action="ToolsRegression"/>
<menuitem action="ToolsSampling"/>
<menuitem action="ToolsOneMedianSignTest"/>
<menu name="ToolTwoMedians" action="MenuToolTwoMedians">
<menuitem action="ToolsTwoMedianSignTest"/>
<menuitem action="ToolsTwoMedianWilcoxonMannWhitney"/>
</menu>
<menu name="ToolTTest" action="MenuToolTTest">
</menu>
<menuitem action="ToolsRanking"/>
</menu>
<menuitem action="ToolsSampling"/>
<menu name="StatisticsTimeSeries" action="MenuStatisticsTimeSeries">
<menu name="ToolForecast" action="MenuToolForecast">
<menuitem action="ToolsExpSmoothing"/>
<menuitem action="ToolsAverage"/>
</menu>
<menuitem action="ToolsFourier"/>
<menuitem action="ToolsKaplanMeier"/>
<menuitem action="ToolsPrincipalComponents"/>
<menuitem action="ToolsRegression"/>
</menu>
<separator/>
<menu name="StatisticsOneSample" action="MenuStatisticsOneSample">
<menuitem action="ToolsNormalityTests"/>
<menu name="ToolOneMedian" action="MenuToolOneMedian">
<menuitem action="ToolsOneMedianSignTest"/>
<menuitem action="ToolsOneMedianWilcoxonSignedRank"/>
</menu>
</menu>
<menu name="StatisticsTwoSamples" action="MenuStatisticsTwoSamples">
<menu name="ToolTTest" action="MenuToolTTest">
<menuitem action="ToolTTestPaired"/>
<menuitem action="ToolTTestEqualVar"/>
<menuitem action="ToolTTestUnequalVar"/>
<menuitem action="ToolZTest"/>
</menu>
<menuitem action="ToolsFTest"/>
</menu>
<menu name="ToolTwoMedians" action="MenuToolTwoMedians">
<menuitem action="ToolsTwoMedianSignTest"/>
<menuitem action="ToolsTwoMedianWilcoxonSignedRank"/>
<menuitem action="ToolsTwoMedianWilcoxonMannWhitney"/>
</menu>
<menuitem action="ToolsFTest"/>
</menu>
<menu name="StatisticsMultipleSamples" action="MenuStatisticsMultipleSamples">
<menu name="ANOVA" action="MenuANOVA">
<menuitem action="ToolsANOVAoneFactor"/>
<menuitem action="ToolsANOVAtwoFactor"/>
</menu>
<menu name="ChiSquareTests" action="MenuContingencyTests">
<menuitem action="ToolsHomogeneity"/>
<menuitem action="ToolsIndependence"/>
</menu>
</menu>
<separator/>
<menuitem action="ToolsPlugins"/>
</menu>
<menu name="Data" action="MenuData">
<menuitem action="DataSort"/>
......
2010-05-31 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* POTFILES.in: added src/tools/analysis-signed-rank-test.c
2010-05-30 Morten Welinder <terra@gnome.org>
* Release 1.10.5
......@@ -203,7 +207,8 @@
2007-12-31 Yannig Marchegay <yannig@marchegay.org>
* oc.po: Updated Occitan translation.
2007-12-21 Jody Goldberg <jody@gnome.org>
2007-12-21 Jody Goldberg <jody@gnome.org>
* Release 1.8.0
......
......@@ -205,6 +205,7 @@ src/tools/analysis-kaplan-meier.c
src/tools/analysis-normality.c
src/tools/analysis-principal-components.c
src/tools/analysis-sign-test.c
src/tools/analysis-signed-rank-test.c
src/tools/analysis-tools.c
src/tools/analysis-wilcoxon-mann-whitney.c
src/tools/dao.c
......
2010-05-31 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* POTFILES.in: added src/tools/analysis-signed-rank-test.c
2010-05-30 Morten Welinder <terra@gnome.org>
* Release 1.10.5
......
......@@ -344,6 +344,7 @@ src/tools/analysis-kaplan-meier.c
src/tools/analysis-normality.c
src/tools/analysis-principal-components.c
src/tools/analysis-sign-test.c
src/tools/analysis-signed-rank-test.c
src/tools/analysis-tools.c
src/tools/analysis-wilcoxon-mann-whitney.c
src/tools/dao.c
......
......@@ -161,48 +161,63 @@
<menuitem action="ToolsScenarioAdd"/>
</menu>
<menuitem action="ToolsSimulation"/>
<menu name="ToolStatisticalAnalysis" action="MenuToolStatisticalAnalysis">
<menu name="ANOVA" action="MenuANOVA">
<menuitem action="ToolsANOVAoneFactor"/>
<menuitem action="ToolsANOVAtwoFactor"/>
</menu>
<menu name="ChiSquareTests" action="MenuContingencyTests">
<menuitem action="ToolsHomogeneity"/>
<menuitem action="ToolsIndependence"/>
</menu>
<menuitem action="ToolsCorrelation"/>
<menuitem action="ToolsCovariance"/>
<menuitem action="ToolsDescStatistics"/>
<menu name="ToolForecast" action="MenuToolForecast">
<menuitem action="ToolsExpSmoothing"/>
<menuitem action="ToolsAverage"/>
</menu>
<menuitem action="ToolsFourier"/>
<menu name="ToolFrequencies" action="MenuToolFrequencies">
<separator/>
<menuitem action="ToolsPlugins"/>
</menu>
<menu name="Statistics" action="MenuStatistics">
<menu name="StatisticsDescriptive" action="MenuStatisticsDescriptive">
<menuitem action="ToolsCorrelation"/>
<menuitem action="ToolsCovariance"/>
<menuitem action="ToolsDescStatistics"/>
<menu name="ToolFrequencies" action="MenuToolFrequencies">
<menuitem action="ToolsFrequency"/>
<menuitem action="ToolsHistogram"/>
</menu>
<menuitem action="ToolsKaplanMeier"/>
<menuitem action="ToolsNormalityTests"/>
<menuitem action="ToolsPrincipalComponents"/>
<menuitem action="ToolsRanking"/>
<menuitem action="ToolsRegression"/>
<menuitem action="ToolsSampling"/>
<menuitem action="ToolsOneMedianSignTest"/>
<menu name="ToolTwoMedians" action="MenuToolTwoMedians">
<menuitem action="ToolsTwoMedianSignTest"/>
<menuitem action="ToolsTwoMedianWilcoxonMannWhitney"/>
</menu>
<menu name="ToolTTest" action="MenuToolTTest">
</menu>
<menuitem action="ToolsRanking"/>
</menu>
<menuitem action="ToolsSampling"/>
<menu name="StatisticsTimeSeries" action="MenuStatisticsTimeSeries">
<menu name="ToolForecast" action="MenuToolForecast">
<menuitem action="ToolsExpSmoothing"/>
<menuitem action="ToolsAverage"/>
</menu>
<menuitem action="ToolsFourier"/>
<menuitem action="ToolsKaplanMeier"/>
<menuitem action="ToolsPrincipalComponents"/>
<menuitem action="ToolsRegression"/>
</menu>
<separator/>
<menu name="StatisticsOneSample" action="MenuStatisticsOneSample">
<menuitem action="ToolsNormalityTests"/>
<menu name="ToolOneMedian" action="MenuToolOneMedian">
<menuitem action="ToolsOneMedianSignTest"/>
<menuitem action="ToolsOneMedianWilcoxonSignedRank"/>
</menu>
</menu>
<menu name="StatisticsTwoSamples" action="MenuStatisticsTwoSamples">
<menu name="ToolTTest" action="MenuToolTTest">
<menuitem action="ToolTTestPaired"/>
<menuitem action="ToolTTestEqualVar"/>
<menuitem action="ToolTTestUnequalVar"/>
<menuitem action="ToolZTest"/>
</menu>
<menuitem action="ToolsFTest"/>
</menu>
<menu name="ToolTwoMedians" action="MenuToolTwoMedians">
<menuitem action="ToolsTwoMedianSignTest"/>
<menuitem action="ToolsTwoMedianWilcoxonSignedRank"/>
<menuitem action="ToolsTwoMedianWilcoxonMannWhitney"/>
</menu>
<menuitem action="ToolsFTest"/>
</menu>
<menu name="StatisticsMultipleSamples" action="MenuStatisticsMultipleSamples">
<menu name="ANOVA" action="MenuANOVA">
<menuitem action="ToolsANOVAoneFactor"/>
<menuitem action="ToolsANOVAtwoFactor"/>
</menu>
<menu name="ChiSquareTests" action="MenuContingencyTests">
<menuitem action="ToolsHomogeneity"/>
<menuitem action="ToolsIndependence"/>
</menu>
</menu>
<separator/>
<menuitem action="ToolsPlugins"/>
</menu>
<menu name="Data" action="MenuData">
<menuitem action="DataSort"/>
......
......@@ -172,42 +172,60 @@
<menuitem action="ToolsScenarioAdd"/>
</menu>
<menuitem action="ToolsSimulation"/>
<separator/>
<menu name="ToolStatisticalAnalysis" action="MenuToolStatisticalAnalysis">
<menu name="ANOVA" action="MenuANOVA">
<menuitem action="ToolsANOVAoneFactor"/>
<menuitem action="ToolsANOVAtwoFactor"/>
</menu>
<menuitem action="ToolsCorrelation"/>
<menuitem action="ToolsCovariance"/>
<menuitem action="ToolsDescStatistics"/>
<menu name="ToolForecast" action="MenuToolForecast">
<menuitem action="ToolsExpSmoothing"/>
<menuitem action="ToolsAverage"/>
</menu>
<menuitem action="ToolsFourier"/>
<menu name="ToolFrequencies" action="MenuToolFrequencies">
</menu>
<menu name="Statistics" action="MenuStatistics">
<menu name="StatisticsDescriptive" action="MenuStatisticsDescriptive">
<menuitem action="ToolsCorrelation"/>
<menuitem action="ToolsCovariance"/>
<menuitem action="ToolsDescStatistics"/>
<menu name="ToolFrequencies" action="MenuToolFrequencies">
<menuitem action="ToolsFrequency"/>
<menuitem action="ToolsHistogram"/>
</menu>
<menuitem action="ToolsKaplanMeier"/>
<menuitem action="ToolsNormalityTests"/>
<menuitem action="ToolsPrincipalComponents"/>
<menuitem action="ToolsRanking"/>
<menuitem action="ToolsRegression"/>
<menuitem action="ToolsSampling"/>
<menuitem action="ToolsOneMedianSignTest"/>
<menu name="ToolTwoMedians" action="MenuToolTwoMedians">
<menuitem action="ToolsTwoMedianSignTest"/>
<menuitem action="ToolsTwoMedianWilcoxonMannWhitney"/>
</menu>
<menu name="ToolTTest" action="MenuToolTTest">
<menuitem action="ToolsRanking"/>
</menu>
<menuitem action="ToolsSampling"/>
<menu name="StatisticsTimeSeries" action="MenuStatisticsTimeSeries">
<menu name="ToolForecast" action="MenuToolForecast">
<menuitem action="ToolsExpSmoothing"/>
<menuitem action="ToolsAverage"/>
</menu>
<menuitem action="ToolsFourier"/>
<menuitem action="ToolsKaplanMeier"/>
<menuitem action="ToolsPrincipalComponents"/>
<menuitem action="ToolsRegression"/>
</menu>
<separator/>
<menu name="StatisticsOneSample" action="MenuStatisticsOneSample">
<menuitem action="ToolsNormalityTests"/>
<menu name="ToolOneMedian" action="MenuToolOneMedian">
<menuitem action="ToolsOneMedianSignTest"/>
<menuitem action="ToolsOneMedianWilcoxonSignedRank"/>
</menu>
</menu>
<menu name="StatisticsTwoSamples" action="MenuStatisticsTwoSamples">
<menu name="ToolTTest" action="MenuToolTTest">
<menuitem action="ToolTTestPaired"/>
<menuitem action="ToolTTestEqualVar"/>
<menuitem action="ToolTTestUnequalVar"/>
<menuitem action="ToolZTest"/>
</menu>
<menuitem action="ToolsFTest"/>
</menu>
<menu name="ToolTwoMedians" action="MenuToolTwoMedians">
<menuitem action="ToolsTwoMedianSignTest"/>
<menuitem action="ToolsTwoMedianWilcoxonSignedRank"/>
<menuitem action="ToolsTwoMedianWilcoxonMannWhitney"/>
</menu>
<menuitem action="ToolsFTest"/>
</menu>
<menu name="StatisticsMultipleSamples" action="MenuStatisticsMultipleSamples">
<menu name="ANOVA" action="MenuANOVA">
<menuitem action="ToolsANOVAoneFactor"/>
<menuitem action="ToolsANOVAtwoFactor"/>
</menu>
<menu name="ChiSquareTests" action="MenuContingencyTests">
<menuitem action="ToolsHomogeneity"/>
<menuitem action="ToolsIndependence"/>
</menu>
</menu>
</menu>
<menu name="Data" action="MenuData">
......
2010-05-31 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* dialogs.h (dialog_sign_test_two_tool): new
* dialog-analysis-tool-sign-test.c
(sign_test_tool_update_common_sensitivity_cb): new
(sign_test_tool_update_sensitivity_cb): split
(sign_test_two_tool_update_sensitivity_cb): new
(sign_test_two_tool_ok_clicked_cb): handle Signed-Rank
(sign_test_tool_ok_clicked_cb): ditto
(dialog_sign_test_two_tool): new
(dialog_sign_test_tool): handle Signed-Rank
* sign-test-two.glade: add radio buttons
* sign-test.glade: ditto
2010-05-30 Morten Welinder <terra@gnome.org>
* Release 1.10.5
......
......@@ -3,9 +3,9 @@
* dialog-analysis-tool-sign-test.c:
*
* Authors:
* Andreas J. Guelzow <aguelzow@taliesin.ca>
* Andreas J. Guelzow <aguelzow@pyrshep.ca>
*
* (C) Copyright 2009 by Andreas J. Guelzow <aguelzow@pyrshep.ca>
* (C) Copyright 2009-2010 by Andreas J. Guelzow <aguelzow@pyrshep.ca>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -27,6 +27,7 @@
#include <gnumeric.h>
#include "dialogs.h"
#include "analysis-sign-test.h"
#include "analysis-signed-rank-test.h"
#include "analysis-tools.h"
#include <workbook.h>
......@@ -71,49 +72,19 @@ typedef struct {
} SignTestToolState;
/**
* sign_test_tool_update_sensitivity_cb:
* sign_test_tool_update_common_sensitivity_cb:
* @dummy:
* @state:
*
* Update the dialog widgets sensitivity
**/
static void
sign_test_tool_update_sensitivity_cb (G_GNUC_UNUSED GtkWidget *dummy,
SignTestToolState *state)
static gboolean
sign_test_tool_update_common_sensitivity_cb (SignTestToolState *state)
{
gnm_float alpha;
gnm_float median;
GSList *input_range;
gboolean err;
/* Checking first input range*/
input_range = gnm_expr_entry_parse_as_list
(GNM_EXPR_ENTRY (state->base.input_entry),
state->base.sheet);
if (input_range == NULL) {
gtk_label_set_text (GTK_LABEL (state->base.warning),
(state->base.input_entry_2 == NULL)
? _("The input range is invalid.")
: _("The first input range is invalid."));
gtk_widget_set_sensitive (state->base.ok_button, FALSE);
return;
} else
range_list_destroy (input_range);
/* Checking second input range*/
if (state->base.input_entry_2 != NULL) {
input_range = gnm_expr_entry_parse_as_list
(GNM_EXPR_ENTRY (state->base.input_entry_2),
state->base.sheet);
if (input_range == NULL) {
gtk_label_set_text (GTK_LABEL (state->base.warning),
_("The second input range is invalid."));
gtk_widget_set_sensitive (state->base.ok_button, FALSE);
return;
} else
range_list_destroy (input_range);
}
/* Checking Median*/
err = entry_to_float
(GTK_ENTRY (state->median_entry), &median, FALSE);
......@@ -121,7 +92,7 @@ sign_test_tool_update_sensitivity_cb (G_GNUC_UNUSED GtkWidget *dummy,
gtk_label_set_text (GTK_LABEL (state->base.warning),
_("The predicted median should be a number."));
gtk_widget_set_sensitive (state->base.ok_button, FALSE);
return;
return FALSE;
}
/* Checking Alpha*/
......@@ -132,7 +103,7 @@ sign_test_tool_update_sensitivity_cb (G_GNUC_UNUSED GtkWidget *dummy,
_("The alpha value should "
"be a number between 0 and 1."));
gtk_widget_set_sensitive (state->base.ok_button, FALSE);
return;
return FALSE;
}
/* Checking Output Page */
......@@ -141,154 +112,318 @@ sign_test_tool_update_sensitivity_cb (G_GNUC_UNUSED GtkWidget *dummy,
_("The output specification "
"is invalid."));
gtk_widget_set_sensitive (state->base.ok_button, FALSE);
return;
return FALSE;
}
gtk_label_set_text (GTK_LABEL (state->base.warning), "");
gtk_widget_set_sensitive (state->base.ok_button, TRUE);
return TRUE;
}
/**
* sign_test_tool_ok_clicked_cb:
* @button:
* sign_test_tool_update_sensitivity_cb:
* @dummy:
* @state:
*
* Retrieve the information from the dialog and call the sign_test_tool.
* Note that we assume that the ok_button is only active if the entry fields
* contain sensible data.
* Update the dialog widgets sensitivity
**/
static void
sign_test_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
sign_test_two_tool_update_sensitivity_cb (G_GNUC_UNUSED GtkWidget *dummy,
SignTestToolState *state)
{
GnmValue *input_range;
gint w, h;
/* Checking first input range*/
input_range = gnm_expr_entry_parse_as_value
(GNM_EXPR_ENTRY (state->base.input_entry),
state->base.sheet);
if (input_range == NULL || input_range->type != VALUE_CELLRANGE) {
gtk_label_set_text (GTK_LABEL (state->base.warning),
(state->base.input_entry_2 == NULL)
? _("The input range is invalid.")
: _("The first input range is invalid."));
gtk_widget_set_sensitive (state->base.ok_button, FALSE);
value_release (input_range);
return;
} else {
GnmRange r;
range_init_rangeref (&r, &(input_range->v_range.cell));
w = range_width (&r);
h = range_height (&r);
value_release (input_range);
}
/* Checking second input range*/
if (state->base.input_entry_2 != NULL) {
input_range = gnm_expr_entry_parse_as_value
(GNM_EXPR_ENTRY (state->base.input_entry_2),
state->base.sheet);
if (input_range == NULL || input_range->type != VALUE_CELLRANGE) {
gtk_label_set_text (GTK_LABEL (state->base.warning),
_("The second input range is invalid."));
gtk_widget_set_sensitive (state->base.ok_button, FALSE);
value_release (input_range);
return;
} else {
GnmRange r;
range_init_rangeref (&r, &(input_range->v_range.cell));
value_release (input_range);
if (w != range_width (&r) ||
h != range_height (&r)) {
gtk_label_set_text
(GTK_LABEL (state->base.warning),
_("The input ranges do not have the same shape."));
gtk_widget_set_sensitive
(state->base.ok_button, FALSE);
return;
}
}
}
if (sign_test_tool_update_common_sensitivity_cb (state)) {
gtk_label_set_text (GTK_LABEL (state->base.warning), "");
gtk_widget_set_sensitive (state->base.ok_button, TRUE);
}
}
static void
sign_test_two_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
SignTestToolState *state)
{
data_analysis_output_t *dao;
GtkWidget *w;
analysis_tools_data_sign_test_t *data;
analysis_tools_data_sign_test_two_t *data;
gboolean err;
analysis_tool_engine engine;
data = g_new0 (analysis_tools_data_sign_test_t, 1);
data = g_new0 (analysis_tools_data_sign_test_two_t, 1);
dao = parse_output ((GenericToolState *)state, NULL);
data->base.input = gnm_expr_entry_parse_as_list (
GNM_EXPR_ENTRY (state->base.input_entry), state->base.sheet);
data->base.group_by = gnumeric_glade_group_value (state->base.gui, grouped_by_group);
data->base.range_1 = gnm_expr_entry_parse_as_value
(GNM_EXPR_ENTRY (state->base.input_entry), state->base.sheet);
data->base.range_2 = gnm_expr_entry_parse_as_value
(GNM_EXPR_ENTRY (state->base.input_entry_2), state->base.sheet);
w = glade_xml_get_widget (state->base.gui, "labels_button");
data->base.labels = gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON (w));
err = entry_to_float
(GTK_ENTRY (state->median_entry), &data->median, FALSE);
data->alpha = gtk_spin_button_get_value
data->base.alpha = gtk_spin_button_get_value
(GTK_SPIN_BUTTON (state->alpha_entry));
if (!cmd_analysis_tool (WORKBOOK_CONTROL (state->base.wbcg), state->base.sheet,
dao, data, analysis_tool_sign_test_engine))
w = glade_xml_get_widget (state->base.gui, "signtest");
engine = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w))
? analysis_tool_sign_test_two_engine
: analysis_tool_signed_rank_test_two_engine;
if (!cmd_analysis_tool (WORKBOOK_CONTROL (state->base.wbcg),
state->base.sheet,
dao, data, engine))
gtk_widget_destroy (state->base.dialog);
return;
}
/**
* dialog_sign_test_two_tool:
*
**/
int
dialog_sign_test_two_tool (WBCGtk *wbcg, Sheet *sheet, signtest_type type)
{
char const * plugins[] = { "Gnumeric_fnstat",
"Gnumeric_fnlogical",
"Gnumeric_fnmath",
"Gnumeric_fninfo",
NULL};
SignTestToolState *state;
GtkWidget *w;
if ((wbcg == NULL) ||
gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
return 1;
/* Only pop up one copy per workbook */
if (gnumeric_dialog_raise_if_exists (wbcg, SIGN_TEST_KEY_TWO))
return 0;
state = g_new0 (SignTestToolState, 1);
if (dialog_tool_init (&state->base, wbcg, sheet,
GNUMERIC_HELP_LINK_SIGN_TEST,
"sign-test-two.glade", "Sign-Test",
_("Could not create the Sign Test Tool dialog."),
SIGN_TEST_KEY_TWO,
G_CALLBACK (sign_test_two_tool_ok_clicked_cb),
NULL,
G_CALLBACK (sign_test_two_tool_update_sensitivity_cb),
GNM_EE_SINGLE_RANGE))
return 0;
state->alpha_entry = glade_xml_get_widget (state->base.gui,
"alpha-entry");
float_to_entry (GTK_ENTRY (state->alpha_entry), 0.05);
g_signal_connect (G_OBJECT (state->alpha_entry),
"value-changed",
G_CALLBACK (sign_test_two_tool_update_sensitivity_cb),
state);
gnumeric_editable_enters (GTK_WINDOW (state->base.dialog),
GTK_WIDGET (state->alpha_entry));
state->median_entry = glade_xml_get_widget (state->base.gui,
"median-entry");
int_to_entry (GTK_ENTRY (state->median_entry), 0);
g_signal_connect_after (G_OBJECT (state->median_entry),
"changed",
G_CALLBACK (sign_test_two_tool_update_sensitivity_cb),
state);
gnumeric_editable_enters (GTK_WINDOW (state->base.dialog),
GTK_WIDGET (state->median_entry));
w = glade_xml_get_widget (state->base.gui,
(type == SIGNTEST) ? "signtest" : "signedranktest");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
gnm_dao_set_put (GNM_DAO (state->base.gdao), TRUE, TRUE);
sign_test_two_tool_update_sensitivity_cb (NULL, state);
tool_load_selection ((GenericToolState *)state, TRUE);
return 0;
}
/************************************************************************************/
/**
* sign_test_tool_ok_clicked_cb:
* @button:
* @state:
*
* Retrieve the information from the dialog and call the sign_test_tool.
* Note that we assume that the ok_button is only active if the entry fields
* contain sensible data.
**/
static void
sign_test_two_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
sign_test_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
SignTestToolState *state)
{
data_analysis_output_t *dao;
GtkWidget *w;
analysis_tools_data_sign_test_two_t *data;
analysis_tools_data_sign_test_t *data;
gboolean err;
analysis_tool_engine engine;
data = g_new0 (analysis_tools_data_sign_test_two_t, 1);
data = g_new0 (analysis_tools_data_sign_test_t, 1);
dao = parse_output ((GenericToolState *)state, NULL);
data->base.range_1 = gnm_expr_entry_parse_as_value
(GNM_EXPR_ENTRY (state->base.input_entry), state->base.sheet);
data->base.range_2 = gnm_expr_entry_parse_as_value
(GNM_EXPR_ENTRY (state->base.input_entry_2), state->base.sheet);
data->base.input = gnm_expr_entry_parse_as_list (
GNM_EXPR_ENTRY (state->base.input_entry), state->base.sheet);
data->base.group_by = gnumeric_glade_group_value (state->base.gui, grouped_by_group);
w = glade_xml_get_widget (state->base.gui, "labels_button");
data->base.labels = gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON (w));
err = entry_to_float
(GTK_ENTRY (state->median_entry), &data->median, FALSE);