projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't append % to count totals.
[pspp-builds.git]
/
src
/
language
/
stats
/
chisquare.c
diff --git
a/src/language/stats/chisquare.c
b/src/language/stats/chisquare.c
index 1b8392724db880a3fdae76187a9e4b2a08ccbe57..158064dcf920b6f539017c57d2bb9203e2c90457 100644
(file)
--- a/
src/language/stats/chisquare.c
+++ b/
src/language/stats/chisquare.c
@@
-29,7
+29,6
@@
#include <data/variable.h>
#include <language/stats/freq.h>
#include <language/stats/npar.h>
#include <data/variable.h>
#include <language/stats/freq.h>
#include <language/stats/npar.h>
-#include <libpspp/alloc.h>
#include <libpspp/assertion.h>
#include <libpspp/compiler.h>
#include <libpspp/hash.h>
#include <libpspp/assertion.h>
#include <libpspp/compiler.h>
#include <libpspp/hash.h>
@@
-39,6
+38,8
@@
#include <gsl/gsl_cdf.h>
#include <gsl/gsl_cdf.h>
+#include "xalloc.h"
+
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include "gettext.h"
#define _(msgid) gettext (msgid)
@@
-361,12
+362,17
@@
chisquare_execute (const struct dataset *ds,
xsq[v] = 0.0;
for ( i = 0 ; i < n_cells ; ++i )
{
xsq[v] = 0.0;
for ( i = 0 ; i < n_cells ; ++i )
{
+ struct string str;
double exp;
const union value *observed_value = ff[i]->value;
double exp;
const union value *observed_value = ff[i]->value;
+ ds_init_empty (&str);
+ var_append_value_name (ost->vars[v], observed_value, &str);
+
/* The key */
/* The key */
- tab_text (freq_table, 0, i + 1, TAB_LEFT,
- var_get_value_name (ost->vars[v], observed_value));
+ tab_text (freq_table, 0, i + 1, TAB_LEFT, ds_cstr (&str));
+ ds_destroy (&str);
+
/* The observed N */
tab_float (freq_table, 1, i + 1, TAB_NONE,
/* The observed N */
tab_float (freq_table, 1, i + 1, TAB_NONE,
@@
-427,13
+433,17
@@
chisquare_execute (const struct dataset *ds,
xsq[v] = 0.0;
for ( i = 0 ; i < hsh_count (freq_hash) ; ++i )
{
xsq[v] = 0.0;
for ( i = 0 ; i < hsh_count (freq_hash) ; ++i )
{
+ struct string str;
double exp;
const union value *observed_value = ff[i]->value;
double exp;
const union value *observed_value = ff[i]->value;
+ ds_init_empty (&str);
+ var_append_value_name (ost->vars[v], observed_value, &str);
/* The key */
tab_text (freq_table, v * 4 + 1, i + 2 , TAB_LEFT,
/* The key */
tab_text (freq_table, v * 4 + 1, i + 2 , TAB_LEFT,
- var_get_value_name (ost->vars[v], observed_value));
+ ds_cstr (&str));
+ ds_destroy (&str);
/* The observed N */
tab_float (freq_table, v * 4 + 2, i + 2 , TAB_NONE,
/* The observed N */
tab_float (freq_table, v * 4 + 2, i + 2 , TAB_NONE,