int binomial;
int wilcoxon;
int sign;
+ int kruskal_wallis;
int missing;
int method;
int statistics;
static int npar_binomial (struct lexer *, struct dataset *, struct npar_specs *);
static int npar_wilcoxon (struct lexer *, struct dataset *, struct npar_specs *);
static int npar_sign (struct lexer *, struct dataset *, struct npar_specs *);
+static int npar_kruskal_wallis (struct lexer *, struct dataset *, struct npar_specs *);
static int npar_method (struct lexer *, struct npar_specs *);
/* Command parsing functions. */
NOT_REACHED ();
}
}
+ else if (lex_match_hyphenated_word (lexer, "K-S") ||
+ lex_match_hyphenated_word (lexer, "KRUSKAL-WALLIS"))
+ {
+ lex_match (lexer, '=');
+ npt->kruskal_wallis++;
+ switch (npar_kruskal_wallis (lexer, ds, nps))
+ {
+ case 0:
+ goto lossage;
+ case 1:
+ break;
+ case 2:
+ lex_error (lexer, NULL);
+ goto lossage;
+ default:
+ NOT_REACHED ();
+ }
+ }
else if (lex_match_hyphenated_word (lexer, "WILCOXON"))
{
lex_match (lexer, '=');
return 1;
}
+static int
+npar_kruskal_wallis (struct lexer *lexer, struct dataset *ds,
+ struct npar_specs *specs)
+{
+ struct n_sample_test *tp = pool_alloc (specs->pool, sizeof (*tp));
+ struct npar_test *nt = &tp->parent;
+
+ nt->insert_variables = n_sample_insert_variables;
+
+ // nt->execute = kruskall_wallis_execute;
+
+ if (!parse_n_sample_related_test (lexer, dataset_dict (ds),
+ tp, specs->pool) )
+ return 0;
+
+ specs->n_tests++;
+ specs->test = pool_realloc (specs->pool,
+ specs->test,
+ sizeof (*specs->test) * specs->n_tests);
+ specs->test[specs->n_tests - 1] = nt;
+
+ return 1;
+}
+
/* Insert the variables for TEST into VAR_HASH */
static void
one_sample_insert_variables (const struct npar_test *test,