+static int
+npar_runs (struct lexer *lexer, struct dataset *ds,
+ struct npar_specs *specs)
+{
+ struct runs_test *rt = pool_alloc (specs->pool, sizeof (*rt));
+ struct one_sample_test *tp = &rt->parent;
+ struct npar_test *nt = &tp->parent;
+
+ nt->execute = runs_execute;
+ nt->insert_variables = one_sample_insert_variables;
+
+ if ( lex_force_match (lexer, T_LPAREN) )
+ {
+ if ( lex_match_id (lexer, "MEAN"))
+ {
+ rt->cp_mode = CP_MEAN;
+ }
+ else if (lex_match_id (lexer, "MEDIAN"))
+ {
+ rt->cp_mode = CP_MEDIAN;
+ }
+ else if (lex_match_id (lexer, "MODE"))
+ {
+ rt->cp_mode = CP_MODE;
+ }
+ else if (lex_is_number (lexer))
+ {
+ rt->cutpoint = lex_number (lexer);
+ rt->cp_mode = CP_CUSTOM;
+ lex_get (lexer);
+ }
+ else
+ {
+ lex_error (lexer, _("Expecting %s, %s, %s or a number."), "MEAN", "MEDIAN", "MODE");
+ return 0;
+ }
+
+ lex_force_match (lexer, T_RPAREN);
+ lex_force_match (lexer, T_EQUALS);
+ if (!parse_variables_const_pool (lexer, specs->pool, dataset_dict (ds),
+ &tp->vars, &tp->n_vars,
+ PV_NO_SCRATCH | PV_NO_DUPLICATE | PV_NUMERIC))
+ {
+ return 2;
+ }
+ }
+
+ 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;
+}
+
+static int
+npar_friedman (struct lexer *lexer, struct dataset *ds,
+ struct npar_specs *specs)
+{
+ struct friedman_test *ft = pool_alloc (specs->pool, sizeof (*ft));
+ struct one_sample_test *ost = &ft->parent;
+ struct npar_test *nt = &ost->parent;
+
+ ft->kendalls_w = false;
+ nt->execute = friedman_execute;
+ nt->insert_variables = one_sample_insert_variables;
+
+ lex_match (lexer, T_EQUALS);
+
+ if (!parse_variables_const_pool (lexer, specs->pool, dataset_dict (ds),
+ &ost->vars, &ost->n_vars,
+ PV_NO_SCRATCH | PV_NO_DUPLICATE | PV_NUMERIC))
+ {
+ return 2;
+ }
+
+ 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;
+}
+
+static int
+npar_kendall (struct lexer *lexer, struct dataset *ds,
+ struct npar_specs *specs)
+{
+ struct friedman_test *kt = pool_alloc (specs->pool, sizeof (*kt));
+ struct one_sample_test *ost = &kt->parent;
+ struct npar_test *nt = &ost->parent;
+
+ kt->kendalls_w = true;
+ nt->execute = friedman_execute;
+ nt->insert_variables = one_sample_insert_variables;
+
+ lex_match (lexer, T_EQUALS);
+
+ if (!parse_variables_const_pool (lexer, specs->pool, dataset_dict (ds),
+ &ost->vars, &ost->n_vars,
+ PV_NO_SCRATCH | PV_NO_DUPLICATE | PV_NUMERIC))
+ {
+ return 2;
+ }
+
+ 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;
+}
+
+
+static int
+npar_cochran (struct lexer *lexer, struct dataset *ds,
+ struct npar_specs *specs)
+{
+ struct one_sample_test *ft = pool_alloc (specs->pool, sizeof (*ft));
+ struct npar_test *nt = &ft->parent;
+
+ nt->execute = cochran_execute;
+ nt->insert_variables = one_sample_insert_variables;
+
+ lex_match (lexer, T_EQUALS);
+
+ if (!parse_variables_const_pool (lexer, specs->pool, dataset_dict (ds),
+ &ft->vars, &ft->n_vars,
+ PV_NO_SCRATCH | PV_NO_DUPLICATE | PV_NUMERIC))
+ {
+ return 2;
+ }
+
+ 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;
+}
+
+