Added the One Sample T Test dialog
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 10 Dec 2007 10:21:05 +0000 (10:21 +0000)
committerJohn Darrington <john@darrington.wattle.id.au>
Mon, 10 Dec 2007 10:21:05 +0000 (10:21 +0000)
src/ui/gui/ChangeLog
src/ui/gui/automake.mk
src/ui/gui/data-editor.c
src/ui/gui/data-editor.h
src/ui/gui/t-test-independent-samples-dialog.c
src/ui/gui/t-test-one-sample.c [new file with mode: 0644]
src/ui/gui/t-test-one-sample.h [new file with mode: 0644]
src/ui/gui/t-test-options.c [new file with mode: 0644]
src/ui/gui/t-test-options.h [new file with mode: 0644]
src/ui/gui/t-test.glade

index e908b7dae5bf2e2690ad23ee8841bc77e6b2d265..fa7e052b30cff8549309c5a999499182efbc705c 100644 (file)
@@ -1,3 +1,16 @@
+2007-12-08  John Darrington <john@darrington.wattle.id.au>
+
+       * data-editor.h data-editor.c: Added hooks for one sample t-test
+
+       * t-test-one-sample.c t-test-one-sample.h (new files): Implemented
+       a dialog box for the One Sample T Test.
+
+       * t-test-independent-samples-dialog.c: Factored out the options sub
+       dialog (see following).
+
+       * t-test-options.c t-test-options.h (new files):  New module
+        implementing the options sub-dialog for T tests.
+
 2007-12-07  John Darrington <john@darrington.wattle.id.au>
 
        * frequencies-dialog.c: Made the options subdialog transient
index 24f0196c3cc6c7dc4a149c9c17455ab313518fbf..a3ad6e1f3daecc0db74004f4c20919420280de7d 100644 (file)
@@ -157,6 +157,10 @@ src_ui_gui_psppire_SOURCES = \
        src/ui/gui/transpose-dialog.h \
        src/ui/gui/t-test-independent-samples-dialog.c \
        src/ui/gui/t-test-independent-samples-dialog.h \
+       src/ui/gui/t-test-one-sample.c \
+       src/ui/gui/t-test-one-sample.h \
+       src/ui/gui/t-test-options.c \
+       src/ui/gui/t-test-options.h \
        src/ui/gui/val-labs-dialog.c \
        src/ui/gui/val-labs-dialog.h \
        src/ui/gui/var-display.c \
index a69b7e665ec7721c3e483c8eacaf3fb8d4bcf59e..cda87a107292ce1c23b09d7978b506d9676eeff4 100644 (file)
@@ -49,6 +49,7 @@
 
 #include "oneway-anova-dialog.h"
 #include "t-test-independent-samples-dialog.h"
+#include "t-test-one-sample.h"
 
 #define _(msgid) gettext (msgid)
 #define N_(msgid) msgid
@@ -612,6 +613,16 @@ new_data_editor (void)
                    G_CALLBACK (t_test_independent_samples_dialog), de);
 
 
+  de->invoke_t_test_one_sample_dialog =
+    gtk_action_new ("t-test-one-sample",
+                   _("One _Sample T Test"),
+                   _("Calculate T Test for sample from a single distribution"),
+                   NULL);
+
+  g_signal_connect (de->invoke_t_test_one_sample_dialog, "activate",
+                   G_CALLBACK (t_test_one_sample_dialog), de);
+
+
   de->invoke_comments_dialog =
     gtk_action_new ("commments-dialog",
                    _("Data File Comments"),
@@ -818,6 +829,12 @@ new_data_editor (void)
                            );
 
 
+  gtk_action_connect_proxy (de->invoke_t_test_one_sample_dialog,
+                           get_widget_assert (de->xml,
+                                              "one-sample-t-test")
+                           );
+
+
   gtk_action_connect_proxy (de->invoke_oneway_anova_dialog,
                            get_widget_assert (de->xml,
                                               "oneway-anova")
index 9f8ce0a698049211292d0100605f9e4b74062b01..97c7c1ec545de8b91e980923f3bef456b12eab5c 100644 (file)
@@ -51,6 +51,7 @@ struct data_editor
 
   GtkAction *invoke_t_test_independent_samples_dialog;
   GtkAction *invoke_oneway_anova_dialog;
+  GtkAction *invoke_t_test_one_sample_dialog;
 
 
   /* Actions which do things */
index 2138317188ddc376e8b5fea8c4f5124247be358e..718709bf23869a3adbaf1459b665b4ff3680bc50 100644 (file)
@@ -29,6 +29,7 @@
 #include "dialog-common.h"
 #include "dict-display.h"
 #include "widget-io.h"
+#include "t-test-options.h"
 
 #include <language/syntax-string-source.h>
 #include "syntax-editor.h"
@@ -44,8 +45,8 @@ struct tt_indep_samples_dialog
   GtkWidget *dialog;
   PsppireDict *dict;
   gboolean groups_defined;
-  gboolean non_default_options;
-  gdouble confidence_interval;
+
+  struct tt_options_dialog *opts;
 };
 
 
@@ -79,21 +80,8 @@ generate_syntax (const struct tt_indep_samples_dialog *d)
       g_string_append (str, ")");
     }
 
-  if ( d->non_default_options )
-    {
-      GtkToggleButton *analysis =
-       GTK_TOGGLE_BUTTON (get_widget_assert (d->xml, "radiobutton1"));
-
-      g_string_append (str, "\n\t");
-      g_string_append_printf (str, "/CRITERIA=CIN(%g)",
-                             d->confidence_interval/100.0);
-
 
-      g_string_append (str, "\n\t");
-      g_string_append_printf (str, "/MISSING=%s",
-                      gtk_toggle_button_get_active (analysis) ?
-                      "ANALYSIS" : "LISTWISE");
-    }
+  tt_options_dialog_append_syntax (d->opts, str);
 
   g_string_append (str, ".\n");
 
@@ -159,43 +147,6 @@ run_define_groups (struct tt_indep_samples_dialog *ttd)
 }
 
 
-static void
-run_options (struct tt_indep_samples_dialog *ttd)
-{
-  gint response;
-  GtkWidget *dialog =
-    get_widget_assert (ttd->xml, "options-dialog");
-
-  GtkWidget *box =
-    get_widget_assert (ttd->xml, "vbox1");
-
-  GtkSpinButton *conf_percent = NULL;
-
-  GtkWidget *confidence =
-    widget_scanf (_("Confidence Interval: %2d %%"),
-                 &conf_percent);
-
-  gtk_spin_button_set_value (conf_percent, ttd->confidence_interval);
-
-  gtk_widget_show (confidence);
-
-  gtk_box_pack_start_defaults (GTK_BOX (box), confidence);
-
-  gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (ttd->dialog));
-
-  response = psppire_dialog_run (PSPPIRE_DIALOG (dialog));
-
-  if ( response == PSPPIRE_RESPONSE_CONTINUE)
-    {
-      ttd->non_default_options = TRUE;
-      ttd->confidence_interval = gtk_spin_button_get_value (conf_percent);
-    }
-
-  gtk_container_remove (GTK_CONTAINER (box), confidence);
-}
-
-
-
 
 static gboolean
 dialog_state_valid (gpointer data)
@@ -250,7 +201,6 @@ t_test_independent_samples_dialog (GObject *o, gpointer data)
   GtkWidget *selector1 =
     get_widget_assert (xml, "indep-samples-t-test-selector1");
 
-
   GtkWidget *entry =
     get_widget_assert (xml, "indep-samples-t-test-entry");
 
@@ -266,8 +216,7 @@ t_test_independent_samples_dialog (GObject *o, gpointer data)
   tt_d.xml = xml;
   tt_d.dict = vs->dict;
   tt_d.groups_defined = FALSE;
-  tt_d.non_default_options = FALSE;
-  tt_d.confidence_interval = 95.0;
+  tt_d.opts = tt_options_dialog_create (xml, de->parent.window);
 
   gtk_window_set_transient_for (GTK_WINDOW (tt_d.dialog), de->parent.window);
 
@@ -294,7 +243,7 @@ t_test_independent_samples_dialog (GObject *o, gpointer data)
 
 
   g_signal_connect_swapped (options_button, "clicked",
-                           G_CALLBACK (run_options), &tt_d);
+                           G_CALLBACK (tt_options_dialog_run), tt_d.opts);
 
 
   g_signal_connect_swapped (tt_d.dialog, "refresh", G_CALLBACK (refresh),  xml);
@@ -332,7 +281,7 @@ t_test_independent_samples_dialog (GObject *o, gpointer data)
       break;
     }
 
-
+  tt_options_dialog_destroy (tt_d.opts);
   g_object_unref (xml);
 }
 
diff --git a/src/ui/gui/t-test-one-sample.c b/src/ui/gui/t-test-one-sample.c
new file mode 100644 (file)
index 0000000..ba27cf2
--- /dev/null
@@ -0,0 +1,214 @@
+/* PSPPIRE - a graphical user interface for PSPP.
+   Copyright (C) 2007  Free Software Foundation
+
+   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
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <config.h>
+#include <glade/glade.h>
+#include <gtk/gtk.h>
+#include "t-test-one-sample.h"
+#include "psppire-dict.h"
+#include "psppire-var-store.h"
+#include "helper.h"
+#include <gtksheet/gtksheet.h>
+#include "data-editor.h"
+#include "psppire-dialog.h"
+#include "dialog-common.h"
+#include "dict-display.h"
+#include "widget-io.h"
+
+#include "t-test-options.h"
+#include <language/syntax-string-source.h>
+#include "syntax-editor.h"
+
+#include <gettext.h>
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
+
+
+struct tt_one_sample_dialog
+{
+  PsppireDict *dict;
+  GtkWidget *vars_treeview;
+  GtkWidget *test_value_entry;
+  struct tt_options_dialog *opt;
+};
+
+
+static gchar *
+generate_syntax (const struct tt_one_sample_dialog *d)
+{
+  gchar *text;
+
+  GString *str = g_string_new ("T-TEST ");
+
+  g_string_append_printf (str, "/TESTVAL=%s",
+                         gtk_entry_get_text (GTK_ENTRY (d->test_value_entry)));
+
+  g_string_append (str, "\n\t/VARIABLES=");
+
+  append_variable_names (str, d->dict, GTK_TREE_VIEW (d->vars_treeview));
+
+  tt_options_dialog_append_syntax (d->opt, str);
+
+  g_string_append (str, ".\n");
+
+  text = str->str;
+
+  g_string_free (str, FALSE);
+
+  return text;
+}
+
+
+
+static void
+refresh (const struct tt_one_sample_dialog *d)
+{
+  GtkTreeModel *model =
+    gtk_tree_view_get_model (GTK_TREE_VIEW (d->vars_treeview));
+
+  gtk_entry_set_text (GTK_ENTRY (d->test_value_entry), "");
+
+  gtk_list_store_clear (GTK_LIST_STORE (model));
+}
+
+
+
+static gboolean
+dialog_state_valid (gpointer data)
+{
+  gchar *s = NULL;
+  const gchar *text;
+  struct tt_one_sample_dialog *tt_d = data;
+
+  GtkTreeModel *vars =
+    gtk_tree_view_get_model (GTK_TREE_VIEW (tt_d->vars_treeview));
+
+  GtkTreeIter notused;
+
+  text = gtk_entry_get_text (GTK_ENTRY (tt_d->test_value_entry));
+
+  if ( 0 == strcmp ("", text))
+    return FALSE;
+
+  /* Check to see if the entry is numeric */
+  g_strtod (text, &s);
+
+  if (s - text != strlen (text))
+    return FALSE;
+
+
+  if ( 0 == gtk_tree_model_get_iter_first (vars, &notused))
+    return FALSE;
+
+  return TRUE;
+}
+
+
+/* Pops up the dialog box */
+void
+t_test_one_sample_dialog (GObject *o, gpointer data)
+{
+  struct tt_one_sample_dialog tt_d;
+  gint response;
+  struct data_editor *de = data;
+
+  PsppireVarStore *vs;
+
+  GladeXML *xml = XML_NEW ("t-test.glade");
+
+  GtkSheet *var_sheet =
+    GTK_SHEET (get_widget_assert (de->xml, "variable_sheet"));
+
+  GtkWidget *dict_view =
+    get_widget_assert (xml, "one-sample-t-test-treeview2");
+
+  GtkWidget *options_button =
+    get_widget_assert (xml, "button1");
+
+  GtkWidget *selector = get_widget_assert (xml, "psppire-selector1");
+
+  GtkWidget *dialog = get_widget_assert (xml, "t-test-one-sample-dialog");
+
+  vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet));
+
+  tt_d.dict = vs->dict;
+  tt_d.vars_treeview = get_widget_assert (xml, "one-sample-t-test-treeview1");
+  tt_d.test_value_entry = get_widget_assert (xml, "test-value-entry");
+  tt_d.opt = tt_options_dialog_create (xml, de->parent.window);
+
+  gtk_window_set_transient_for (GTK_WINDOW (dialog), de->parent.window);
+
+  attach_dictionary_to_treeview (GTK_TREE_VIEW (dict_view),
+                                vs->dict,
+                                GTK_SELECTION_MULTIPLE,
+                                var_is_numeric);
+
+  set_dest_model (GTK_TREE_VIEW (tt_d.vars_treeview), vs->dict);
+
+
+  psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
+                                dict_view, tt_d.vars_treeview,
+                                insert_source_row_into_tree_view,
+                                NULL);
+
+
+  g_signal_connect_swapped (dialog, "refresh",
+                           G_CALLBACK (refresh),  &tt_d);
+
+
+  g_signal_connect_swapped (options_button, "clicked",
+                           G_CALLBACK (tt_options_dialog_run), tt_d.opt);
+
+  psppire_dialog_set_valid_predicate (PSPPIRE_DIALOG (dialog),
+                                     dialog_state_valid, &tt_d);
+
+  response = psppire_dialog_run (PSPPIRE_DIALOG (dialog));
+
+  switch (response)
+    {
+    case GTK_RESPONSE_OK:
+      {
+       gchar *syntax = generate_syntax (&tt_d);
+       struct getl_interface *sss = create_syntax_string_source (syntax);
+       execute_syntax (sss);
+
+       g_free (syntax);
+      }
+      break;
+    case PSPPIRE_RESPONSE_PASTE:
+      {
+       gchar *syntax = generate_syntax (&tt_d);
+
+       struct syntax_editor *se =
+         (struct syntax_editor *) window_create (WINDOW_SYNTAX, NULL);
+
+       gtk_text_buffer_insert_at_cursor (se->buffer, syntax, -1);
+
+       g_free (syntax);
+      }
+      break;
+    default:
+      break;
+    }
+
+
+  g_object_unref (xml);
+  tt_options_dialog_destroy (tt_d.opt);
+}
+
+
diff --git a/src/ui/gui/t-test-one-sample.h b/src/ui/gui/t-test-one-sample.h
new file mode 100644 (file)
index 0000000..6d50f11
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef T_TEST_ONE_SAMPLE_DIALOG
+#define T_TEST_ONE_SAMPLE_DIALOG
+
+void t_test_one_sample_dialog (GObject *, gpointer) ;
+
+#endif
diff --git a/src/ui/gui/t-test-options.c b/src/ui/gui/t-test-options.c
new file mode 100644 (file)
index 0000000..37bdc22
--- /dev/null
@@ -0,0 +1,130 @@
+/* PSPPIRE - a graphical user interface for PSPP.
+   Copyright (C) 2007  Free Software Foundation
+
+   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
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <config.h>
+#include <gtk/gtk.h>
+
+#include "psppire-dialog.h"
+#include <gl/xalloc.h>
+#include "helper.h"
+#include "t-test-options.h"
+
+#include "widget-io.h"
+
+#include <gettext.h>
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
+
+
+enum exclude_mode
+  {
+    EXCL_ANALYSIS,
+    EXCL_LISTWISE
+  };
+
+struct tt_options_dialog
+{
+  GtkWidget *dialog;
+  GtkWidget *box;
+  GtkWidget *confidence;
+  GtkSpinButton *conf_percent;
+  GtkToggleButton *analysis;
+  GtkToggleButton *listwise;
+
+  gdouble confidence_interval;
+  gboolean non_default_options;
+  enum exclude_mode excl;
+};
+
+struct tt_options_dialog *
+tt_options_dialog_create (GladeXML *xml, GtkWindow *parent)
+{
+  struct tt_options_dialog *tto = xmalloc (sizeof (*tto));
+
+  tto->confidence =
+    widget_scanf (_("Confidence Interval: %2d %%"),
+                 &tto->conf_percent);
+
+  tto->dialog = get_widget_assert (xml, "options-dialog");
+
+  tto->box =   get_widget_assert (xml, "vbox1");
+
+  tto->analysis = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "radiobutton1"));
+  tto->listwise = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "radiobutton2"));
+
+  gtk_widget_show (tto->confidence);
+
+  gtk_box_pack_start_defaults (GTK_BOX (tto->box), tto->confidence);
+
+  gtk_window_set_transient_for (parent, GTK_WINDOW (tto->dialog));
+
+  tto->confidence_interval = 95;
+  tto->excl = EXCL_ANALYSIS;
+
+  return tto;
+}
+
+
+void
+tt_options_dialog_destroy (struct tt_options_dialog *tto)
+{
+  gtk_container_remove (GTK_CONTAINER (tto->box), tto->confidence);
+  g_free (tto);
+}
+
+
+void
+tt_options_dialog_run (struct tt_options_dialog *tto)
+{
+  gint response;
+
+  if ( tto->excl == EXCL_ANALYSIS)
+    gtk_toggle_button_set_active (tto->analysis, TRUE);
+  else
+    gtk_toggle_button_set_active (tto->listwise, TRUE);
+
+  gtk_spin_button_set_value (tto->conf_percent, tto->confidence_interval);
+
+  response = psppire_dialog_run (PSPPIRE_DIALOG (tto->dialog));
+
+  if ( response == PSPPIRE_RESPONSE_CONTINUE)
+    {
+      tto->non_default_options = TRUE;
+
+      tto->confidence_interval = gtk_spin_button_get_value (tto->conf_percent);
+      if ( gtk_toggle_button_get_active (tto->analysis) )
+       tto->excl = EXCL_ANALYSIS;
+      else
+       tto->excl = EXCL_LISTWISE;
+    }
+}
+
+void
+tt_options_dialog_append_syntax (struct tt_options_dialog *tto, GString *str)
+{
+  g_string_append (str, "\t/MISSING=");
+
+  if ( tto->excl == EXCL_ANALYSIS )
+    g_string_append (str, "ANALYSIS");
+  else
+    g_string_append (str, "LISTWISE");
+
+
+  g_string_append_printf (str, "\n\t/CRITERIA=CIN(%g)",
+                         tto->confidence_interval/100.0);
+}
diff --git a/src/ui/gui/t-test-options.h b/src/ui/gui/t-test-options.h
new file mode 100644 (file)
index 0000000..fdb2d87
--- /dev/null
@@ -0,0 +1,35 @@
+/* PSPPIRE - a graphical user interface for PSPP.
+   Copyright (C) 2007  Free Software Foundation
+
+   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
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef T_TEST_OPTIONS_DIALOG
+#define T_TEST_OPTIONS_DIALOG
+
+
+struct tt_options_dialog;
+
+
+void tt_options_dialog_run (struct tt_options_dialog *);
+
+struct tt_options_dialog * tt_options_dialog_create (GladeXML *, GtkWindow *);
+
+void tt_options_dialog_destroy (struct tt_options_dialog *);
+
+
+void tt_options_dialog_append_syntax (struct tt_options_dialog *, GString *);
+
+
+#endif
index c5119ef00675a4758b8bfd11f5c1d86bf90190c8..afa954e4c2544afdf04e44ba0d75a0bb949d2766 100644 (file)
                 <property name="n_rows">3</property>
                 <property name="n_columns">2</property>
                 <child>
-                  <widget class="GtkHButtonBox" id="hbuttonbox1">
+                  <widget class="GtkVBox" id="vbox30">
                     <property name="visible">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
                     <child>
-                      <widget class="GtkButton" id="define-groups-button">
+                      <widget class="GtkLabel" id="label36">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="label" translatable="yes">Define Groups</property>
-                        <property name="response_id">0</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Grouping Variable:</property>
                       </widget>
                       <packing>
                         <property name="expand">False</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkButton" id="options-button">
+                      <widget class="GtkEntry" id="indep-samples-t-test-entry">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="label" translatable="yes">Options...</property>
-                        <property name="response_id">0</property>
                       </widget>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
                         <property name="position">1</property>
                       </packing>
                     </child>
                   </widget>
                   <packing>
+                    <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
-                    <property name="y_options">GTK_FILL</property>
-                    <property name="y_padding">5</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="PsppireSelector" id="indep-samples-t-test-selector1">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="border_width">5</property>
-                  </widget>
-                  <packing>
-                    <property name="x_options"></property>
-                    <property name="y_options">GTK_EXPAND</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="PsppireSelector" id="indep-samples-t-test-selector2">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="border_width">5</property>
-                  </widget>
-                  <packing>
                     <property name="top_attach">1</property>
                     <property name="bottom_attach">2</property>
-                    <property name="x_options"></property>
                     <property name="y_options"></property>
                   </packing>
                 </child>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkVBox" id="vbox30">
+                  <widget class="PsppireSelector" id="indep-samples-t-test-selector2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="border_width">5</property>
+                  </widget>
+                  <packing>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
+                    <property name="x_options"></property>
+                    <property name="y_options"></property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="PsppireSelector" id="indep-samples-t-test-selector1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="border_width">5</property>
+                  </widget>
+                  <packing>
+                    <property name="x_options"></property>
+                    <property name="y_options">GTK_EXPAND</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkHButtonBox" id="hbuttonbox1">
                     <property name="visible">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
                     <child>
-                      <widget class="GtkLabel" id="label36">
+                      <widget class="GtkButton" id="define-groups-button">
                         <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Grouping Variable:</property>
+                        <property name="label" translatable="yes">Define Groups</property>
                       </widget>
                       <packing>
                         <property name="expand">False</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkEntry" id="indep-samples-t-test-entry">
+                      <widget class="GtkButton" id="options-button">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="label" translatable="yes">Options...</property>
                       </widget>
                       <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
                         <property name="position">1</property>
                       </packing>
                     </child>
                   </widget>
                   <packing>
-                    <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                    <property name="y_options"></property>
+                    <property name="top_attach">2</property>
+                    <property name="bottom_attach">3</property>
+                    <property name="y_options">GTK_FILL</property>
+                    <property name="y_padding">5</property>
                   </packing>
                 </child>
               </widget>
             <property name="n_columns">2</property>
             <property name="column_spacing">5</property>
             <child>
-              <widget class="GtkLabel" id="label2">
+              <widget class="GtkEntry" id="group1-entry">
                 <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+              </widget>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkEntry" id="group2-entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="label" translatable="yes">Group_2 value:</property>
-                <property name="use_underline">True</property>
               </widget>
               <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
                 <property name="top_attach">1</property>
                 <property name="bottom_attach">2</property>
-                <property name="x_options"></property>
               </packing>
             </child>
             <child>
               </packing>
             </child>
             <child>
-              <widget class="GtkEntry" id="group2-entry">
+              <widget class="GtkLabel" id="label2">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="label" translatable="yes">Group_2 value:</property>
+                <property name="use_underline">True</property>
               </widget>
               <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
                 <property name="top_attach">1</property>
                 <property name="bottom_attach">2</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkEntry" id="group1-entry">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-              </widget>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
+                <property name="x_options"></property>
               </packing>
             </child>
           </widget>
               <widget class="GtkFrame" id="frame1">
                 <property name="visible">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="label_xalign">0</property>
                 <child>
                   <widget class="GtkAlignment" id="alignment1">
                     <property name="visible">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                             <property name="label" translatable="yes">Exclude cases _analysis by analysis</property>
                             <property name="use_underline">True</property>
-                            <property name="response_id">0</property>
                             <property name="active">True</property>
                             <property name="draw_indicator">True</property>
                           </widget>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                             <property name="label" translatable="yes">Exclude cases _listwise</property>
                             <property name="use_underline">True</property>
-                            <property name="response_id">0</property>
                             <property name="active">True</property>
                             <property name="draw_indicator">True</property>
                             <property name="group">radiobutton1</property>
       </widget>
     </child>
   </widget>
+  <widget class="PsppireDialog" id="t-test-one-sample-dialog">
+    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+    <property name="title">One - Sample T Test</property>
+    <property name="modal">True</property>
+    <property name="orientation">PSPPIRE_TABULAR</property>
+    <child internal-child="hbox">
+      <widget class="GtkTable" id="dialog-hbox5">
+        <property name="visible">True</property>
+        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+        <property name="n_rows">2</property>
+        <property name="n_columns">4</property>
+        <child>
+          <widget class="GtkAlignment" id="alignment3">
+            <property name="visible">True</property>
+            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+            <property name="yalign">0.059999998658895493</property>
+            <property name="yscale">0</property>
+            <child>
+              <widget class="PsppireSelector" id="psppire-selector1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="no_show_all">True</property>
+                <property name="border_width">5</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="bottom_attach">2</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkButton" id="button1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+            <property name="label" translatable="yes">Options...</property>
+          </widget>
+          <packing>
+            <property name="left_attach">3</property>
+            <property name="right_attach">4</property>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="y_options"></property>
+            <property name="x_padding">5</property>
+            <property name="y_padding">5</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkHBox" id="hbox2">
+            <property name="visible">True</property>
+            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+            <child>
+              <widget class="GtkLabel" id="label7">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Test Value: </property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkEntry" id="test-value-entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">5</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="left_attach">2</property>
+            <property name="right_attach">3</property>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="y_options"></property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkScrolledWindow" id="scrolledwindow4">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+            <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+            <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+            <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+            <child>
+              <widget class="GtkTreeView" id="one-sample-t-test-treeview2">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="headers_visible">False</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="bottom_attach">2</property>
+            <property name="x_padding">5</property>
+            <property name="y_padding">5</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkFrame" id="frame2">
+            <property name="visible">True</property>
+            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+            <property name="shadow_type">GTK_SHADOW_NONE</property>
+            <child>
+              <widget class="GtkAlignment" id="alignment2">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <widget class="GtkScrolledWindow" id="scrolledwindow3">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+                    <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                    <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+                    <child>
+                      <widget class="GtkTreeView" id="one-sample-t-test-treeview1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="headers_visible">False</property>
+                      </widget>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label6">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="label" translatable="yes">Test Variable(s):</property>
+                <property name="use_markup">True</property>
+              </widget>
+              <packing>
+                <property name="type">label_item</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="left_attach">2</property>
+            <property name="right_attach">3</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="PsppireVButtonBox" id="psppire-vbuttonbox5">
+            <property name="visible">True</property>
+            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+            <property name="border_width">5</property>
+          </widget>
+          <packing>
+            <property name="left_attach">3</property>
+            <property name="right_attach">4</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
 </glade-interface>