X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fcrosstabs.c;h=1b203083e0768b6f738c7c7e67e8d2b5c1a277c3;hb=72c9c6a2f92e94779b2e55d0726568090411871c;hp=9e77c666a5c19dc9a3c3fb9ac43f72059b2a83fe;hpb=f4491cda2715c59495d963d0a3d8ae4518c1c13d;p=pspp diff --git a/src/language/stats/crosstabs.c b/src/language/stats/crosstabs.c index 9e77c666a5..1b203083e0 100644 --- a/src/language/stats/crosstabs.c +++ b/src/language/stats/crosstabs.c @@ -305,6 +305,7 @@ cmd_crosstabs (struct lexer *lexer, struct dataset *ds) .descending = false, }; bool show_tables = true; + int exclude_ofs = 0; lex_match (lexer, T_SLASH); for (;;) { @@ -316,6 +317,7 @@ cmd_crosstabs (struct lexer *lexer, struct dataset *ds) else if (lex_match_id (lexer, "MISSING")) { lex_match (lexer, T_EQUALS); + exclude_ofs = lex_ofs (lexer); if (lex_match_id (lexer, "TABLE")) proc.exclude = MV_ANY; else if (lex_match_id (lexer, "INCLUDE")) @@ -472,8 +474,9 @@ cmd_crosstabs (struct lexer *lexer, struct dataset *ds) /* Missing values. */ if (proc.mode == GENERAL && !proc.exclude) { - msg (SE, _("Missing mode %s not allowed in general mode. " - "Assuming %s."), "REPORT", "MISSING=TABLE"); + lex_ofs_error (lexer, exclude_ofs, exclude_ofs, + _("Missing mode %s not allowed in general mode. " + "Assuming %s."), "REPORT", "MISSING=TABLE"); proc.exclude = MV_ANY; } @@ -656,7 +659,8 @@ parse_crosstabs_variables (struct lexer *lexer, struct dataset *ds, { if (proc->n_pivots) { - msg (SE, _("%s must be specified before %s."), "VARIABLES", "TABLES"); + lex_next_error (lexer, -1, -1, _("%s must be specified before %s."), + "VARIABLES", "TABLES"); return false; } @@ -1717,7 +1721,8 @@ display_crosstabulation (struct crosstabs_proc *proc, double expected_value = xt->row_tot[r] * xt->col_tot[c] / xt->total; double residual = *mp - expected_value; double sresidual = residual / sqrt (expected_value); - double asresidual = (sresidual + double asresidual + = residual / sqrt (expected_value * (1. - xt->row_tot[r] / xt->total) * (1. - xt->col_tot[c] / xt->total)); double entries[CRS_N_CELLS] = {