#define REG_LARGE_DATA 1000
+#define STATS_R 1
+#define STATS_COEFF 2
+#define STATS_ANOVA 4
+#define STATS_OUTS 8
+#define STATS_CI 16
+#define STATS_BCOV 32
+
+#define STATS_DEFAULT (STATS_R | STATS_COEFF | STATS_ANOVA | STATS_OUTS)
+
+
+
struct regression
{
struct dataset *ds;
const struct variable **dep_vars;
size_t n_dep_vars;
- bool r;
- bool coeff;
- bool anova;
- bool bcov;
-
+ unsigned int stats;
bool resid;
bool pred;
memset (®ression, 0, sizeof (struct regression));
- regression.anova = true;
- regression.coeff = true;
- regression.r = true;
-
+ regression.stats = STATS_DEFAULT;
regression.pred = false;
regression.resid = false;
{
if (lex_match (lexer, T_ALL))
{
+ regression.stats = ~0;
}
else if (lex_match_id (lexer, "DEFAULTS"))
{
+ regression.stats |= STATS_DEFAULT;
}
else if (lex_match_id (lexer, "R"))
{
+ regression.stats |= STATS_R;
}
else if (lex_match_id (lexer, "COEFF"))
{
+ regression.stats |= STATS_COEFF;
}
else if (lex_match_id (lexer, "ANOVA"))
{
+ regression.stats |= STATS_ANOVA;
}
else if (lex_match_id (lexer, "BCOV"))
{
+ regression.stats |= STATS_BCOV;
+ }
+ else if (lex_match_id (lexer, "CI"))
+ {
+ regression.stats |= STATS_CI;
+
+ if (lex_match (lexer, T_LPAREN))
+ {
+ lex_number (lexer);
+ lex_get (lexer);
+ lex_force_match (lexer, T_RPAREN);
+ }
}
else
{
*/
msg (SW,
gettext
- ("The dependent variable is equal to the independent variable."
- "The least squares line is therefore Y=X."
+ ("The dependent variable is equal to the independent variable. "
+ "The least squares line is therefore Y=X. "
"Standard errors and related statistics may be meaningless."));
n_indep_vars = 1;
indep_vars[0] = cmd->vars[0];
subcommand_statistics (const struct regression *cmd, const linreg * c, const gsl_matrix * cm,
const struct variable *var)
{
- if (cmd->r)
+ if (cmd->stats & STATS_R)
reg_stats_r (c, var);
- if (cmd->anova)
+ if (cmd->stats & STATS_ANOVA)
reg_stats_anova (c, var);
- if (cmd->coeff)
+ if (cmd->stats & STATS_COEFF)
reg_stats_coeff (c, cm, var);
- if (cmd->bcov)
+ if (cmd->stats & STATS_BCOV)
reg_stats_bcov (c, var);
}
tab_text (t, 3, 0, TAB_CENTER | TAT_TITLE, _("Std. Error"));
tab_text (t, 4, 0, TAB_CENTER | TAT_TITLE, _("Beta"));
tab_text (t, 5, 0, TAB_CENTER | TAT_TITLE, _("t"));
- tab_text (t, 6, 0, TAB_CENTER | TAT_TITLE, _("Significance"));
+ tab_text (t, 6, 0, TAB_CENTER | TAT_TITLE, _("Sig."));
tab_text (t, 1, 1, TAB_LEFT | TAT_TITLE, _("(Constant)"));
tab_double (t, 2, 1, 0, linreg_intercept (c), NULL);
std_err = sqrt (gsl_matrix_get (linreg_cov (c), 0, 0));
tab_text (t, 3, 0, TAB_CENTER | TAT_TITLE, _("df"));
tab_text (t, 4, 0, TAB_CENTER | TAT_TITLE, _("Mean Square"));
tab_text (t, 5, 0, TAB_CENTER | TAT_TITLE, _("F"));
- tab_text (t, 6, 0, TAB_CENTER | TAT_TITLE, _("Significance"));
+ tab_text (t, 6, 0, TAB_CENTER | TAT_TITLE, _("Sig."));
tab_text (t, 1, 1, TAB_LEFT | TAT_TITLE, _("Regression"));
tab_text (t, 1, 2, TAB_LEFT | TAT_TITLE, _("Residual"));