- The status of dialog box widgets are now preserved between calls
to the same dialog box for the same dataset.
+ - The dialog box for the Logistic Regression command will now
+ infer that string variables or any varible with a "measure"
+ of Nominal or Ordinal are to be treated as categorical variables
+ and will generate syntax accordingly.
+
* The pspp-convert utility can now decrypt encrypted syntax files.
The encrypted syntax file format is unacceptably insecure, so to
discourage its use PSPP and PSPPIRE do not directly read or write
g_string_append (strx, dep);
- g_string_append (strx, " WITH ");
+ g_string_append (strx, " WITH");
- psppire_var_view_append_names (PSPPIRE_VAR_VIEW (rd->indep_vars), 0, strx);
+ GSList *vars = psppire_var_view_list_names (PSPPIRE_VAR_VIEW (rd->indep_vars), 0);
+ GSList *node = vars;
+ GString *var_names = g_string_new ("");
+ while (node)
+ {
+ g_string_prepend (var_names, var_get_name (node->data));
+ g_string_prepend (var_names, " ");
+ node = node->next;
+ }
+
+ g_string_append (strx, var_names->str);
+ g_string_free (var_names, TRUE);
+
+
+ GString *categoricals = g_string_new ("");
+ for (node = vars; node; node = node->next)
+ {
+ const struct variable *v = node->data;
+ enum measure m = var_get_measure (v);
+
+ if (m == MEASURE_NOMINAL || m == MEASURE_ORDINAL || var_is_alpha (v))
+ {
+ g_string_prepend (categoricals, var_get_name (v));
+ g_string_prepend (categoricals, " ");
+ }
+ }
+ if (0 != strcmp (categoricals->str, ""))
+ g_string_prepend (categoricals, "\n\t/CATEGORICAL =");
+
+ g_string_append (strx, categoricals->str);
+ g_string_free (categoricals, TRUE);
+ g_slist_free (vars);
+
g_string_append (strx, "\n\t/CRITERIA =");
g_string_append_printf (strx, " CUT(%g)", rd->cut_point);
return n_vars;
}
+/* Return a linked list of struct variables which are
+ contained in VV.
+ The caller is responsible for freeing the returned list.
+ The variables however are owned by their dictionary
+ and should not be freed.
+ */
+GSList *
+psppire_var_view_list_names (PsppireVarView *vv, gint column)
+{
+ GtkTreeIter iter;
+ GSList *list = NULL;
+
+ if ( psppire_var_view_get_iter_first (vv, &iter) )
+ {
+ do
+ {
+ const struct variable *var = psppire_var_view_get_variable (vv, column, &iter);
+ list = g_slist_prepend (list, var);
+ }
+ while (psppire_var_view_get_iter_next (vv, &iter));
+ }
+
+ return list;
+}
+
/*
Append the names of selected variables to STR
gboolean psppire_var_view_get_iter_next (PsppireVarView *vv, GtkTreeIter *iter);
+GSList *psppire_var_view_list_names (PsppireVarView *vv, gint column);
+
+
const struct variable * psppire_var_view_get_variable (PsppireVarView *vv, gint column, GtkTreeIter *iter);
const struct variable * psppire_var_view_get_var_from_model (GtkTreeModel *, gint column, GtkTreeIter *iter);