X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fregression.c;h=d9409aae59bcc1301e16ed05770606457194915d;hb=3368d7a7d2e5fd6c284781aa327daff250922756;hp=cbffb7d45ecf909a473edf5caa1844dfa2368b81;hpb=e19fd7f7bb229404630b50b4c2fe4b1244d54eb0;p=pspp diff --git a/src/language/stats/regression.c b/src/language/stats/regression.c index cbffb7d45e..d9409aae59 100644 --- a/src/language/stats/regression.c +++ b/src/language/stats/regression.c @@ -225,8 +225,7 @@ cmd_regression (struct lexer *lexer, struct dataset *ds) if (lex_match_id (lexer, "DEPENDENT")) { - if (!lex_force_match (lexer, T_EQUALS)) - goto error; + lex_match (lexer, T_EQUALS); free (regression.dep_vars); regression.n_dep_vars = 0; @@ -248,6 +247,7 @@ cmd_regression (struct lexer *lexer, struct dataset *ds) } else if (lex_match_id (lexer, "STATISTICS")) { + unsigned long statistics = 0; lex_match (lexer, T_EQUALS); while (lex_token (lexer) != T_ENDCMD @@ -255,31 +255,31 @@ cmd_regression (struct lexer *lexer, struct dataset *ds) { if (lex_match (lexer, T_ALL)) { - regression.stats = ~0; + statistics = ~0; } else if (lex_match_id (lexer, "DEFAULTS")) { - regression.stats |= STATS_DEFAULT; + statistics |= STATS_DEFAULT; } else if (lex_match_id (lexer, "R")) { - regression.stats |= STATS_R; + statistics |= STATS_R; } else if (lex_match_id (lexer, "COEFF")) { - regression.stats |= STATS_COEFF; + statistics |= STATS_COEFF; } else if (lex_match_id (lexer, "ANOVA")) { - regression.stats |= STATS_ANOVA; + statistics |= STATS_ANOVA; } else if (lex_match_id (lexer, "BCOV")) { - regression.stats |= STATS_BCOV; + statistics |= STATS_BCOV; } else if (lex_match_id (lexer, "CI")) { - regression.stats |= STATS_CI; + statistics |= STATS_CI; if (lex_match (lexer, T_LPAREN)) { @@ -294,6 +294,10 @@ cmd_regression (struct lexer *lexer, struct dataset *ds) goto error; } } + + if (statistics) + regression.stats = statistics; + } else if (lex_match_id (lexer, "SAVE")) { @@ -335,6 +339,8 @@ cmd_regression (struct lexer *lexer, struct dataset *ds) workspace.pred_idx = -1; workspace.writer = NULL; workspace.reader = NULL; + workspace.residvars = NULL; + workspace.predvars = NULL; if (save) { int i;